ios - Swift error: Could not find an overload for '==' that accepts the supplied arguments? -
this question has answer here:
actually iam checking internet connection in code , weird error "could not find overload '==' accepts supplied arguments"
here code snippet,
override func viewdidload() { super.viewdidload() checkknetworkstatus() let requesturl = nsurl(string: "http://example") let request = nsurlrequest(url: requesturl!) webview.loadrequest(request) } func checkknetworkstatus(){ let networkchecking : reachability = reachability.reachabilityforinternetconnection() networkchecking.startnotifier() var status : networkstatus = networkchecking.currentreachabilitystatus() if (status == notreachable) ***//error*** { // statement } }
you can if (status == .notreachable)
or if (status == networkstatus.notreachable)
.
Comments
Post a Comment