Latest 0.0.1
Homepage https://github.com/ioramashvili/RadioAccessTechnologyNotifier
License MIT
Platforms ios 9.0
Authors

Detect if network is on Wifi, LTE, 3G or Edge

Requirements

  • iOS 9.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate TableViewReloadAnimation into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'RadioAccessTechnologyNotifier'
end

Then, run the following command:

$ pod install

Usage

import RadioAccessTechnologyNotifier

in viewDidAppear

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // set delegate
        RadioAccessTechnologyNotifier.shared.delegate = self

        // get notification
        NotificationCenter.default.addObserver(
            self,
            selector: #selector(radioAccessTechnologyNotifierStateDidChange),
            name: RadioAccessTechnologyNotifierStateDidChange,
            object: nil)
    }

    func radioAccessTechnologyNotifierStateDidChange() {
        print(RadioAccessTechnologyNotifier.shared.currentState)
    }
}

extension ViewController: RadioAccessTechnologyNotifierDelegate {
    func didChange(to state: RadioAccessTechnologyNotifierState) {
        print(state)
    }
}

Latest podspec

{
    "name": "RadioAccessTechnologyNotifier",
    "version": "0.0.1",
    "summary": "Network state change notifier",
    "description": "Detect if network is on Wifi, LTE, 3G or Edge",
    "homepage": "https://github.com/ioramashvili/RadioAccessTechnologyNotifier",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "shota ioramashvili": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ioramashvili/RadioAccessTechnologyNotifier.git",
        "tag": "0.0.1"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": [
        "RadioAccessTechnologyNotifier/RadioAccessTechnologyNotifier.swift",
        "RadioAccessTechnologyNotifier/Reachability.swift"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This