Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sauvikatinnofied/95a07994c4ec72ae462e4469929c37de to your computer and use it in GitHub Desktop.
Save sauvikatinnofied/95a07994c4ec72ae462e4469929c37de to your computer and use it in GitHub Desktop.
Medium Blog Post Gist
extension ViewController: NetworkStatusListener {
func networkStatusDidChange(status: Reachability.NetworkStatus) {
switch status {
case .notReachable:
debugPrint("ViewController: Network became unreachable")
case .reachableViaWiFi:
debugPrint("ViewController: Network reachable through WiFi")
case .reachableViaWWAN:
debugPrint("ViewController: Network reachable through Cellular Data")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment