NetworkReachability is a replacement for Apple’s SystemConfiguration Network Reachability APIs. Because these APIs were originally written in C, they are old and cumbersome to use from Swift. NetworkReachability wraps these APIs in Swift and provides a modern interface for the most common use cases.
NetworkReachability supports synchronous reachability queries, as well as constant asynchronous reachability observation via the following mechanisms:
NetworkReachability is currently distributed exclusively through the Swift Package Manager.
To add NetworkReachability as a dependency to an existing Swift package, add the following line of code to the
dependencies parameter of your
dependencies: [ .package(url: "https://github.com/vsanthanam/NetworkReachability.git", .upToNextMajor(from: "1.0.0")) ]
To add NetworkReachability as a dependency to an Xcode Project:
- Enter package URL
https://github.com/vsanthanam/NetworkReachability.gitand select your release and of choice.
Other distribution mechanisms like CocoaPods or Carthage may be added in the future.