Created
January 23, 2018 10:54
-
-
Save fakiho/c72413535dfb48aca817fc80bd30942c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import Foundation | |
| import Alamofire | |
| class Connectivity { | |
| class func isConnectedToInternet() ->Bool { | |
| return NetworkReachabilityManager()!.isReachable | |
| } | |
| } |
This file contains hidden or 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
| if Connectivity.isConnectedToInternet() { | |
| print("Yes! internet is available.") | |
| // do some tasks.. | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment