Latest | 0.4.0 |
---|---|
Homepage | https://github.com/ezefranca/EFInternetIndicator |
License | MIT |
Platforms | ios 9.0 |
Authors |
Requirements
- Xcode 8.0+
- iOS 8.3+
WARNING : It’s not work on simulator. #1
Installation
CocoaPods
You can use CocoaPods to install EFInternetIndicator
by adding it to your Podfile
:
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()
import UIKit
import EFInternetIndicator
class ViewController: UIViewController, InternetStatusIndicable {
var internetConnectionIndicator:InternetViewIndicator?
override func viewDidLoad() {
super.viewDidLoad()
self.startMonitoringInternet()
}
}
Also, you can customize indicator using custom parameters:
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:
import UIKit
import EFInternetIndicator
class 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 for SwiftMessages;
- @ashleymills for Reachability.swift;
License
EFInternetIndicator is available under the MIT license. See the LICENSE file for more info.
Latest podspec
{ "name": "EFInternetIndicator", "version": "0.4.0", "summary": "A little Internet status indicator.", "description": "A little swift Internet error status indicator using ReachabilitySwift.", "homepage": "https://github.com/ezefranca/EFInternetIndicator", "screenshots": "https://media.giphy.com/media/3Pumvj8kXlsze/giphy.gif", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "ezefranca": "[email protected]" }, "source": { "git": "https://github.com/ezefranca/EFInternetIndicator.git" }, "social_media_url": "https://twitter.com/ezefranca", "platforms": { "ios": "9.0" }, "source_files": "EFInternetIndicator/Classes/**/*.{c,h,hh,m,mm,swift}", "pushed_with_swift_version": "3.0", "subspecs": [ { "name": "Interface", "dependencies": { "SwiftMessages": [] } } ] }
Wed, 18 Oct 2017 04:00:11 +0000