Hello, I have an app and I inserted the internet connection check in viewDidAppear, I wanted to know how I can reload this screen when the user clicks RETRY on the Alert, to do 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)
}
}