TimeParadox
TimeParadox

Reputation: 318

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

Upvotes: 4

Views: 11380

Answers (1)

Alessandro Ornano
Alessandro Ornano

Reputation: 35382

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()
  }

Upvotes: 8

Related Questions