Latest 0.1.0
Homepage https://github.com/AfrozZaheer/AZReachabilityNotificatons
License MIT
Platforms ios 9.0
Dependencies Alamofire, CWStatusBarNotification, Whisper
Authors

AZReachability Notifications

AZReachabilityNotificatons

Swift version
Support Dependecy Manager
Version
License
Platform


AZReachabilityNotificatons


AZReachabilityNotificatons

Features

  • Simple, one method integration
  • Reachability notification on status bar and under navigation bar

Installation

CocoaPods

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

$ gem install cocoapods

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

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

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

Then, run the following command:

$ pod install

Usage

Step 1

Import AZReachabilityNotificatons module in AppDelegate.swift and just call startNetworkReachabilityObserver


import UIKit
import AZReachabilityNotificatons

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    let reachAbilityManager = ReachabilityManager.manager

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        reachAbilityManager.startNetworkReachabilityObserver(notificationType: .OnStatusBar) //enum to detrmin notification type

        return true
    }

    func applicationWillTerminate(_ application: UIApplication) {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
        reachAbilityManager.stopNetworkReachability()
    }
}

Customization

  • To show notification on status bar
    reachAbilityManager.startNetworkReachabilityObserver(notificationType: .OnStatusBar) 

And for under Navigation bar

    reachAbilityManager.startNetworkReachabilityObserver(notificationType: .UnderNavigation)
  • To have custom Strings in notification and change notification background color use this

    
    
    reachAbilityManager.internetAvailableBackgroundColor = UIColor.green // internet connectd 
    reachAbilityManager.internetNotAvailableBackgroundColor = UIColor.red // internet is not connected 
    
    reachAbilityManager.internetAvailableText = "Internet Connected" // internet is not connected
    reachAbilityManager.internetNotAvailableText = "No Internet Connection" // internet is not connected


#### Done
Thats it, you successfully integrate AZReachabilityNotificatons 

#### Dependencies
* Alamofire 
* CWStatusBarNotification
* Whisper

## License

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

## Author

**Afroz Zaheer** - (https://github.com/AfrozZaheer)

Latest podspec

{
    "name": "AZReachabilityNotificatons",
    "version": "0.1.0",
    "summary": "Internet Notifications",
    "description": "Show Internet notifications with Reachability",
    "homepage": "https://github.com/AfrozZaheer/AZReachabilityNotificatons",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "AfrozZ": "[email protected]"
    },
    "source": {
        "git": "https://github.com/AfrozZaheer/AZReachabilityNotificatons.git"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "AZReachabilityNotificatons/**/*.{swift}",
    "dependencies": {
        "Alamofire": [],
        "CWStatusBarNotification": [],
        "Whisper": []
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This