Skip to content

sauvikdolui/NetworkStatusMonitorPart1

Repository files navigation

NetworkStatusMonitorStarter

Repository for project of Medium Blog Network reachability status monitoring on iOS (Part 1)

How to use?

  1. Install ReachibilitySwift with pod ‘ReachabilitySwift’, ‘~> 3’ with cocoapods
  2. Drag and Drop ReachabilityManager.swift to your project from ...NetworkStatusMonitorPart1/NetworkStatusMonitor/Networking/Core

Start monitoring for reachability

Override AppDelegate's func applicationDidBecomeActive(_:)

func applicationDidBecomeActive(_ application: UIApplication) {
    // Starts monitoring network reachability status changes
    ReachabilityManager.shared.startMonitoring()
}

Stop monitoring for reachability

Override AppDelegate's func applicationWillEnterForeground(_:)

func applicationWillEnterForeground(_ application: UIApplication) {
  // Stops monitoring network reachability status changes
  ReachabilityManager.shared.stopMonitoring()
}

Result

Output Video

About

Repository for Medium Blog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published