Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ezefranca/EFInternetIndicator
โ๐ฑ A little swift Internet error status indicator using ReachabilitySwift
https://github.com/ezefranca/EFInternetIndicator
internet reachability status swift-3
Last synced: about 1 month ago
JSON representation
โ๐ฑ A little swift Internet error status indicator using ReachabilitySwift
- Host: GitHub
- URL: https://github.com/ezefranca/EFInternetIndicator
- Owner: ezefranca
- License: other
- Created: 2017-02-21T18:25:31.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-04T08:22:44.000Z (over 5 years ago)
- Last Synced: 2024-04-24T19:04:51.355Z (9 months ago)
- Topics: internet, reachability, status, swift-3
- Language: Swift
- Homepage:
- Size: 257 KB
- Stars: 129
- Watchers: 6
- Forks: 16
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - EFInternetIndicator - A little swift Internet error status indicator using ReachabilitySwift. (Networking / Video)
- awesome-ios-star - EFInternetIndicator - A little swift Internet error status indicator using ReachabilitySwift. (Networking / Video)
README
# EFInternetIndicator
[![CI Status](http://img.shields.io/travis/ezefranca/EFInternetIndicator.svg?style=flat)](https://travis-ci.org/ezefranca/EFInternetIndicator)
[![Version](https://img.shields.io/cocoapods/v/EFInternetIndicator.svg?style=flat)](http://cocoapods.org/pods/EFInternetIndicator)
[![License](https://img.shields.io/cocoapods/l/EFInternetIndicator.svg?style=flat)](http://cocoapods.org/pods/EFInternetIndicator)
[![Platform](https://img.shields.io/cocoapods/p/EFInternetIndicator.svg?style=flat)](http://cocoapods.org/pods/EFInternetIndicator)![](https://media.giphy.com/media/3Pumvj8kXlsze/giphy.gif)![](https://media.giphy.com/media/hbZFtkGO3oXTi/giphy.gif)![](https://media.giphy.com/media/bqSwgtKgJD1uw/giphy.gif)
## Requirements
- Xcode 8.0+
- iOS 8.3+**WARNING** : It's not work on simulator. [#1](https://github.com/ezefranca/EFInternetIndicator/issues/1)
## Installation
#### CocoaPods
You can use [CocoaPods](http://cocoapods.org/) to install `EFInternetIndicator` by adding it to your `Podfile`:```ruby
use_frameworks!
pod 'EFInternetIndicator'
```## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Usage example
To start monitoring internet status in a single UIViewController you just need add the ```InternetStatusIndicable``` protocol and start monitoring with ```startMonitoringInternet()```
```swift
import UIKit
import EFInternetIndicatorclass ViewController: UIViewController, InternetStatusIndicable {
var internetConnectionIndicator:InternetViewIndicator?
override func viewDidLoad() {
super.viewDidLoad()
self.startMonitoringInternet()
}
}```
Also, you can customize indicator using custom parameters:
```swift
func startMonitoringInternet(backgroundColor:UIColor, style: MessageView.Layout, textColor:UIColor, message:String, remoteHostName: String)
```If you want all yours UIViewControllers monitoring internet you can create a abstract class like:
```swift
import UIKit
import EFInternetIndicatorclass EFViewController: UIViewController, InternetStatusIndicable {
var internetConnectionIndicator:InternetViewIndicator?
override func viewDidLoad() {
super.viewDidLoad()
self.startMonitoringInternet()
}
}class SecondViewController: EFViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
}// Override properties when you want
class MagicViewController: EFViewController {
override func viewDidLoad() {
super.viewDidLoad()
ย ย ย ย self.startMonitoringInternet(backgroundColor:UIColor.blue, style: .StatusLine, textColor:UIColor.white, message:"No magic on internet here :(", remoteHostName: "magic.com")
}
}```
## Author
ezefranca, [email protected]
## Acknowledgments
- [@SwiftKickMobile](https://github.com/SwiftKickMobile) for SwiftMessages;
- [@ashleymills](https://github.com/ashleymills) for Reachability.swift;## License
EFInternetIndicator is available under the MIT license. See the LICENSE file for more info.