https://github.com/dominatorvbn/snapreachability
https://github.com/dominatorvbn/snapreachability
hacktoberfest hacktoberfest2022
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/dominatorvbn/snapreachability
- Owner: DominatorVbN
- License: mit
- Created: 2019-07-18T05:57:53.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-13T20:36:53.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T14:11:26.515Z (4 months ago)
- Topics: hacktoberfest, hacktoberfest2022
- Language: Swift
- Homepage:
- Size: 68.4 KB
- Stars: 4
- Watchers: 0
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SnapReachability
[](https://travis-ci.org/DominatorVbN/SnapReachability)
[](https://cocoapods.org/pods/SnapReachability)
[](https://cocoapods.org/pods/SnapReachability)
[](https://cocoapods.org/pods/SnapReachability)## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
SnapReachability is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'SnapReachability'
```
## Usage
```swift
import SnapReachability
...
//start listening for network events
ReachabilityManager.shared.stopMonitoring()
ReachabilityManager.shared.addListener(listener: self)//stop listening for networl events
ReachabilityManager.shared.stopMonitoring()
ReachabilityManager.shared.removeListener(listener: self)//implement NetworkStatusListnerProtocol
extension YouClas: NetworkStatusListener{
switch reachability.connection {
case .unavailable:
debugPrint("Network became unreachable")
case .wifi:
debugPrint("Network reachable through WiFi")
case .cellular:
debugPrint("Network reachable through Cellular Data")
case .none:
debugPrint("Unkown netwoprk status")
}
}
```
## AuthorDominatorVbN, [email protected]
## License
SnapReachability is available under the MIT license. See the LICENSE file for more info.