Last active
October 24, 2016 09:20
-
-
Save sauvikatinnofied/c9afc31e2dc4205195affbbfee977b2e to your computer and use it in GitHub Desktop.
Medium Blog Post Snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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