Skip to content

whitesmith/WSReachability

Repository files navigation

WSReachability

Carthage Compatible SwiftPM Compatible CocoaPods Compatible Swift 3.0 Platforms iOS License MIT

Monitor the network state of an iOS device using the System Configuration.

Usage

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)
}

Installation

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.

Manually

Download all the source files and drop them into your project.

Requirements

  • iOS 8.0+
  • Xcode 8.3 (Swift 3.0)

Contributing

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. :octocat:

Credits

Whitesmith

About

Monitor the network state of an iOS device using the System Configuration

Resources

License

Stars

Watchers

Forks

Packages

No packages published