DispatchQueue.main.async {
self.reachability.whenReachable = { reachability in
if reachability.connection == .wifi {
print("Reachable via WiFi")
} else {
print("Reachable via Cellular")
}
}
self.reachability.whenUnreachable = { _ in
print("Not reachable")
}
do {
try self.reachability.startNotifier()
} catch {
print("Unable to start notifier")
}
}
getting 3 syntex error assist.
whenReachability Cannot infer type of closure parameter 'reachability' without a type annotation
Why is this happening with one particular project when I go run this project all I see three red flags . What is happening here?