Popularity
2.7
Growing
Activity
1.0
Declining
127
5
12

Programming language: Swift
Tags: Networking    

EFInternetIndicator alternatives and similar libraries

Based on the "Networking" category

Do you think we are missing an alternative of EFInternetIndicator or a related project?

Add another 'Networking' Library

README

EFInternetIndicator

CI Status Version License Platform

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, ezequiel.ifsp@gmail.com

Acknowledgments

License

EFInternetIndicator is available under the MIT license. See the LICENSE file for more info.


*Note that all licence references and agreements mentioned in the EFInternetIndicator README section above are relevant to that project's source code only.