Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sauvikatinnofied/c9afc31e2dc4205195affbbfee977b2e to your computer and use it in GitHub Desktop.
Save sauvikatinnofied/c9afc31e2dc4205195affbbfee977b2e to your computer and use it in GitHub Desktop.
Medium Blog Post Snippet
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")
}
// Update login button Enable/Disable status
loginButton.isEnabled = !(status == .notReachable)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment