Giter Site home page Giter Site logo

efinternetindicator's Introduction

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, [email protected]

Acknowledgments

License

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

efinternetindicator's People

Contributors

ezefranca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

efinternetindicator's Issues

Statusbar rawvalue not found

Screenshot 2022-10-20 at 12 52 15 AM

I am getting this issue "Cannot convert value of type 'CGFloat' to expected argument type 'UIWindow.Level' Replace 'UIWindow.Level.statusBar.rawValue' with 'UIWindow.Level(rawValue: UIWindow.Level.statusBar.rawValue) ?? <#default value#>' "

app delegate

@ezefranca Is there anyway to check internet from app delegate instead of going into each view controller and writing these lines of code.

Where is the swift 3.2 support ?

My project is on swift 3 still and I don't seem to find support for this. Earlier I have used this library and coded for it but now my project doesn't seem to find support for the swift 3. Can you please send me the version number for swift 3 support

Feature Request

Would it makes sense to add a porperty 'isOnline' so that I quickly can check if the device is online?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.