-
Notifications
You must be signed in to change notification settings - Fork 949
Home
Reachability.swift is a replacement for Apple's Reachability re-written in Swift with closures
Inspired by https://github.com/tonymillion/Reachability
Swift 2.0 now supports C-function pointers! Check out the develop branch for the Swift 2.0 version of Reachability.swift - this hasn't been tested yet, so please raise bugs for any issues with it.
As of Swift 1.2, you cannot convert Swift closures into C-function pointers, meaning we can't set an SCNetworkReachabilityCallBack. To get around this, this reachability replacement uses a dispatch_source firing at 1/2 second intervals.
If an application has the privacy option “Use cellular data” turned off, the Reachability class still reports isReachable() to be true. There is currently no (non-private) API to detect this. If you need this feature, please raise file a bug report with Apple to get this fixed. See devforums thread for details: https://devforums.apple.com/message/1059332#1059332059332
https://github.com/ashleymills/Reachability.swift/wiki/Apps-using-Reachability.swift