1
I have a webview app, after the lauchScreen it goes to the Viewcontroller where it loads the page, I have a class that checks if there is a connection, and if there is not I would like to open a new screen warning that it is not connected or show a button that of a Reload in the app, in order to try to open again and if there is connection the app open normally.
Follows the code:
class ViewController: UIViewController {
@IBOutlet weak var WebView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
if(CheckInternet.Connection()){
let url = URL(string: "https://google.com")
let request = URLRequest(url:url!)
WebView.load(request)
}else{
//caso n tenha conexão com a internet
}
}
}