Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift: How to let a webview reload its url

I have a app with a website. On the website there are links to other sites and pages of the website but how can I reload the page with a button or a tabbar that it goes back to the main page from the webview

like image 552
TimeParadox Avatar asked Feb 06 '23 18:02

TimeParadox


1 Answers

You can simply create two button, one to goes back and one to refresh and then connect these IBActions:

  @IBAction func doRefresh(AnyObject) {
    webView.reload()
  }

  @IBAction func goBack(AnyObject) {
    webView.goBack()
  }
like image 182
Alessandro Ornano Avatar answered Feb 11 '23 16:02

Alessandro Ornano