Skip to content

Cannot infer contextual base in reference to member 'wifi' #417

@kundancodelab

Description

@kundancodelab

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions