When I try to check for an internet connection on my iPhone I get a bunch of errors. Can anyone help me to fix this?
The code:
import Foundation impo
struct Connectivity { static let sharedInstance = NetworkReachabilityManager()! static var isConnectedToInternet:Bool { return self.sharedInstance.isReachable } }
Now call it
if Connectivity.isConnectedToInternet{ call_your_methods_here() }else{ show_alert_for_noInternet() }