Skip to content

Instantly share code, notes, and snippets.

@stfalconaleks
Created October 20, 2017 14:39
Show Gist options
  • Save stfalconaleks/6dbdf5b1c62d3752ac334fe31dbc381d to your computer and use it in GitHub Desktop.
Save stfalconaleks/6dbdf5b1c62d3752ac334fe31dbc381d to your computer and use it in GitHub Desktop.
//internet connection
UHBConnectivityManager.shared().registerCallBack({ [weak self] (status:
ConnectivityManagerConnectionStatus) in
if status == ConnectivityManagerConnectionStatusConnected {
print("Internet connected")
SocketManager.sharedInstance.reconnect()
self?.alertVC.dismiss(animated: true, completion: nil)
} else {
print("No connection")
SocketManager.sharedInstance.closeConnection()
VCManager.sharedInstance.topViewController()?.present((self?.alertVC)!, animated: true, completion: nil)
}
}, forIdentifier: self.memoryAddress())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment