Monitor the network state of an iOS device using the System Configuration.
Create an instance passing a host that you want to listen:
let reachability = WSReachability(use: "api.greatproject.io")
Listen for event changes:
reachability?.listen { reachable in
print("Great Project API is reachable:", reachable)
}
It's possible to log each event that's occurring by subscribing it:
reachability?.log.subscribe { message in
print("Reachability:", message)
}
To install it, simply add the following line to your Cartfile:
github "whitesmith/WSReachability"
Then run carthage update
.
Follow the current instructions in Carthage's README for up to date installation instructions.
To install it, simply add the following line to your Podfile:
pod 'WSReachability'
You will also need to make sure you're opting into using frameworks:
use_frameworks!
Then run pod install
with CocoaPods 1.0 or newer.
Download all the source files and drop them into your project.
- iOS 8.0+
- Xcode 8.3 (Swift 3.0)
The best way to contribute is by submitting a pull request. We'll do our best to respond to your patch as soon as possible. You can also submit a new GitHub issue if you find bugs or have questions.