Popularity
5.9
Stable
Activity
0.0
Stable
459
26
119
Programming language: Swift
License: MIT License
Tags:
Network
Reach alternatives and similar libraries
Based on the "Network" category.
Alternatively, view Reach 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β¦) -
SwiftSoup
SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS) -
Zewo
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines. -
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. -
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. -
PeerKit
An open-source Swift framework for building event-driven, zero-config Multipeer Connectivity apps -
Digger
Digger is a lightweight download framework that requires only one line of code to complete the file download task -
SOAPEngine
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app. -
BigBrother
DISCONTINUED. Automatically sets the network activity indicator for any performed request.
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
Promo
coderabbit.ai
* 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 Reach or a related project?
README
Reach
A simple class to check for internet connection availability in Swift. Works for both 3G and WiFi connections.
Install
Manually
- Add the Reach.swift file to your project.
Usage
There are two ways to get network status information from Reach.
- Call
Reach().connectionStatus()
. The network status is returned in an enum calledReachabilityStatus
.
let status = Reach().connectionStatus()
switch status {
case .unknown, .offline:
print("Not connected")
case .online(.wwan):
print("Connected via WWAN")
case .online(.wiFi):
print("Connected via WiFi")
}
- By subscribing to
ReachabilityStatusChangedNotification
s. The network status is returned as a string.
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(ViewController.networkStatusChanged(_:)), name: Notification.Name(rawValue: ReachabilityStatusChangedNotification), object: nil)
Reach().monitorReachabilityChanges()
}
@objc func networkStatusChanged(_ notification: Notification) {
if let userInfo = notification.userInfo {
let status = userInfo["Status"] as! String
print(status)
}
}
ToDo
- [ ] Return storngly typed object containing more information about the network status.
Credits
- Chris Danielson is the author of the original code written in Objective-C.
- Martin R from StackOverflow helped me immensely in converting C code to Swift.