Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-13T20:36:53.000Z (over 4 years ago)
- Last Synced: 2024-11-07T18:18:20.112Z (about 2 months ago)
- Topics: hacktoberfest, hacktoberfest2022
- Language: Swift
- Homepage:
- Size: 68.4 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SnapReachability
[![CI Status](https://img.shields.io/travis/DominatorVbN/SnapReachability.svg?style=for-the-badge)](https://travis-ci.org/DominatorVbN/SnapReachability)
[![Version](https://img.shields.io/cocoapods/v/SnapReachability.svg?style=for-the-badge)](https://cocoapods.org/pods/SnapReachability)
[![License](https://img.shields.io/cocoapods/l/SnapReachability.svg?style=for-the-badge)](https://cocoapods.org/pods/SnapReachability)
[![Platform](https://img.shields.io/cocoapods/p/SnapReachability.svg?style=for-the-badge)](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.