I am currently developing a project using Reachability library in xCode8 beta6(swift3). I think I correctly implemented Reachability.swift into my project.
By the way, the app crashes in the following line of Reachability.swift when I call reachability.startNotifier()
.
let reachability = Reachability()!
NSNotificationCenter.defaultCenter().addObserver(self, selector: "reachabilityChanged:",name: ReachabilityChangedNotification,object: reachability)
do{
try reachability.startNotifier()
}catch{
print("could not start reachability notifier")
}
Here is what I can see in the log.
*** NSForwarding: warning: object 0x10d939668 of class 'WebClient' does not implement methodSignatureForSelector: -- trouble ahead Unrecognized selector +[WebClient reachabilityChanged:]
Of course, I did implemented reachabilityChanged selector function.
func reachabilityChanged(note: NSNotification) {
let reachability = note.object as! Reachability
if reachability.isReachable {
if self.pendingSurvey == true {
....
}
}
}
I am spending much time to find the reason but I can not figure it out.