Modern Network Reachability in Swift using Structured Concurrency

What's New



What's Changed

  • Fix missing trailing parenthesis in sample code by @vsanthanam in #48

Full Changelog: 1.5.0...1.5.1


NetworkReachability is a replacement for Apple's SystemConfiguration Network Reachability APIs. Because these APIs were originally written in C, they are quite old and cumbersome to use from Swift. In 2018, Apple added the Network framework which introduced the NWPathMonitor class. This API addressed some of the problems with SCNetworkReachability, but was still cumbersome to integrate into many commonly used app patterns. NetworkReachability wraps both these APIs in easy to use Swift wrappers with similar interfaces and features that will be familiar to most iOS developers. Using NetworkReachablity, you can easily integrate reachability observation into your app's pipeline using just a few lines of code.

NetworkReachability supports synchronous reachability queries, as well as constant asynchronous reachability observation via the following mechanisms:

NetworkReachability supports RxSwift bindings with an optional additional package: NetworkReachabilityRxSwift. This optional package exists so that you can safely depend on NetworkReachability without also depending on RxSwift if you don't need to. NetworkReachability itself has no non-apple dependencies.


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 Package.swift file:

dependencies: [
    .package(url: "", from: "1.0.0")

To add NetworkReachability as a dependency to an Xcode Project:

  • Choose FileAdd Packages...
  • Enter package URL and select your release of choice.

Other distribution mechanisms like CocoaPods or Carthage may be added in the future.

Usage & Documentation

NetworkReachability's documentation is built with DocC and included in the repository as a DocC archive. The latest version is hosted on GitHub Pages and is available here.


Additional installation instructions are available on the Swift Package Index


NetworkReachability is available under the MIT license. See the LICENSE file for more information.


  • Swift Tools 5.8.0
View More Packages from this Author


Last updated: Fri Apr 26 2024 20:34:43 GMT-0900 (Hawaii-Aleutian Daylight Time)