0
Hello, I have an app and I entered the check of connection to the internet in viewDidAppear, I wanted to know how to give a Reload on this screen when the user click in RETRY of Alert, to make the check again.
override func viewDidAppear(_ animated: Bool) {
if Reachability.isConnectedToNetwork() == true
{
print("Connected")
}
else
{
let controller = UIAlertController(title: "No Internet Detected", message: "This app requires an Internet connection", preferredStyle: .alert)
// Create the actions
let retry = UIAlertAction(title: "Retry", style: UIAlertActionStyle.default) {
UIAlertAction in
NSLog("Retry Pressed")
}
controller.addAction(retry)
present(controller, animated: true, completion: nil)
}
}