Skip to content

Instantly share code, notes, and snippets.

@fakiho
Created January 23, 2018 10:54
Show Gist options
  • Select an option

  • Save fakiho/c72413535dfb48aca817fc80bd30942c to your computer and use it in GitHub Desktop.

Select an option

Save fakiho/c72413535dfb48aca817fc80bd30942c to your computer and use it in GitHub Desktop.
import Foundation
import Alamofire
class Connectivity {
class func isConnectedToInternet() ->Bool {
return NetworkReachabilityManager()!.isReachable
}
}
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