Reachability.swift alternatives and similar libraries
Based on the "Network" category.
Alternatively, view Reachability.swift alternatives based on common mentions on social networks and blogs.
-
Perfect
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…) -
swifter
Tiny http server engine written in Swift programming language. -
SwiftSoup
SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS) -
Netfox
A lightweight, one line setup, iOS / OSX network debugging library! 🦊 -
SwiftHTTP
Thin wrapper around NSURLSession in swift. Simplifies HTTP requests. -
Siesta
The civilized way to write REST API clients for iOS / macOS -
SwiftSocket
The easy way to use sockets on Apple platforms -
APIKit
Type-safe networking abstraction layer that associates request type with response type. -
CocoaMQTT
MQTT 5.0 client library for iOS and macOS written in Swift -
Swifton
A Ruby on Rails inspired Web Framework for Swift that runs on Linux and OS X -
Zewo
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines. -
ResponseDetective
Sherlock Holmes of the networking layer. :male_detective: -
SwiftWebSocket
A high performance WebSocket client library for swift. -
BlueSocket
Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux. -
Connectivity
🌐 Makes Internet connectivity detection more robust by detecting Wi-Fi networks without Internet access. -
OAuth2
OAuth2 framework for macOS and iOS, written in Swift. -
WKZombie
WKZombie is a Swift framework for iOS/OSX to navigate within websites and collect data without the need of User Interface or API, also known as Headless browser. It can be used to run automated tests / snapshots and manipulate websites using Javascript. -
Taylor
A lightweight library for writing HTTP web servers with Swift -
Pitaya
🏇 A Swift HTTP / HTTPS networking library just incidentally execute on machines -
Blackfish
A minimal, fast and unopinionated web framework for Swift -
PeerKit
An open-source Swift framework for building event-driven, zero-config Multipeer Connectivity apps -
Express
Swift Express is a simple, yet unopinionated web application server written in Swift -
Heimdallr.swift
Easy to use OAuth 2 library for iOS, written in Swift. -
Embassy
Super lightweight async HTTP server library in pure Swift runs in iOS / MacOS / Linux -
Reach
A simple class to check for internet connection availability in Swift. -
Socks
🔌 Non-blocking TCP socket layer, with event-driven server and client. -
Digger
Digger is a lightweight download framework that requires only one line of code to complete the file download task -
PMHTTP
Swift/Obj-C HTTP framework with a focus on REST and JSON -
SOAPEngine
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app. -
Transporter
A tiny library makes uploading and downloading easier -
SwiftyOAuth
A simple OAuth library for iOS with a built-in set of providers -
XcodeServerSDK
Access Xcode Server API with native Swift objects. -
Malibu
:surfer: Malibu is a networking library built on promises -
BigBrother
Automatically sets the network activity indicator for any performed request. -
Curassow
Swift HTTP server using the pre-fork worker model
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Reachability.swift or a related project?
README
Reachability.swift
Reachability.swift is a replacement for Apple's Reachability sample, re-written in Swift with closures.
It is compatible with iOS (8.0 - 12.0), OSX (10.9 - 10.14) and tvOS (9.0 - 12.0)
Inspired by https://github.com/tonymillion/Reachability
Supporting Reachability.swift
Keeping Reachability.swift up-to-date is a time consuming task. Making updates, reviewing pull requests, responding to issues and answering emails all take time.
Please consider sponsoring me https://github.com/sponsors/ashleymills, it's a great way to say thanks!
If you're an iOS developer who's looking for a quick and easy way to create App Store screenshots, please try out my app Screenshot Producer…
Devices | Layout | Copy | Localize | Export |
---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
And don't forget to ★ the repo. This increases its visibility and encourages others to contribute.
Thanks Ash
Got a problem?
Please read https://github.com/ashleymills/Reachability.swift/blob/master/CONTRIBUTING.md before raising an issue.
Installation
Manual
Just drop the Reachability.swift file into your project. That's it!
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. To install Reachability.swift with CocoaPods:
Make sure CocoaPods is installed.
Update your Podfile to include the following:
use_frameworks! pod 'ReachabilitySwift'
Run
pod install
.In your code import Reachability like so:
import Reachability
Carthage
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To install Reachability.swift with Carthage:
Install Carthage via Homebrew
$ brew update $ brew install carthage
Add
github "ashleymills/Reachability.swift"
to your Cartfile.Run
carthage update
.Drag
Reachability.framework
from theCarthage/Build/iOS/
directory to theLinked Frameworks and Libraries
section of your Xcode project’sGeneral
settings.Add
$(SRCROOT)/Carthage/Build/iOS/Reachability.framework
toInput Files
of Run Script Phase for Carthage.In your code import Reachability like so:
import Reachability
Swift Package Manager (SPM)
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. To integrate using Apple's Swift package manager from xcode :
File -> Swift Packages -> Add Package Dependency...
Enter package URL : https://github.com/ashleymills/Reachability.swift, choose the latest release
Example - closures
NOTE: All closures are run on the main queue.
//declare this property where it won't go out of scope relative to your listener
let reachability = try! Reachability()
reachability.whenReachable = { reachability in
if reachability.connection == .wifi {
print("Reachable via WiFi")
} else {
print("Reachable via Cellular")
}
}
reachability.whenUnreachable = { _ in
print("Not reachable")
}
do {
try reachability.startNotifier()
} catch {
print("Unable to start notifier")
}
and for stopping notifications
reachability.stopNotifier()
Example - notifications
NOTE: All notifications are delivered on the main queue.
//declare this property where it won't go out of scope relative to your listener
let reachability = try! Reachability()
//declare this inside of viewWillAppear
NotificationCenter.default.addObserver(self, selector: #selector(reachabilityChanged(note:)), name: .reachabilityChanged, object: reachability)
do{
try reachability.startNotifier()
}catch{
print("could not start reachability notifier")
}
and
@objc func reachabilityChanged(note: Notification) {
let reachability = note.object as! Reachability
switch reachability.connection {
case .wifi:
print("Reachable via WiFi")
case .cellular:
print("Reachable via Cellular")
case .unavailable:
print("Network not reachable")
}
}
and for stopping notifications
reachability.stopNotifier()
NotificationCenter.default.removeObserver(self, name: .reachabilityChanged, object: reachability)
Want to help?
Got a bug fix, or a new feature? Create a pull request and go for it!
Let me know!
If you use Reachability.swift, please let me know about your app and I'll put a link here… and tell your friends!
Cheers, Ash