ios - UIWebView UIViewController does not load URL -
i having issue ios app.
when click on url button uiwebview loads correct url in first instance when visit page within same web view frame stores page memory. when navigate button , click previous button shows page in instead of loading url.
what want achieve when user clicks on button uiwebview loads url .
my current code:
import uikit class menuviewcontroller: uiviewcontroller { @iboutlet weak var oyebwebview: uiwebview! override func viewdidload() { super.viewdidload() oyebwebview.loadrequest(nsurlrequest(url: nsurl(string: menuurl)!)) // additional setup after loading view. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. }
you can use following code work.
import uikit class menuviewcontroller: uiviewcontroller { @iboutlet weak var oyebwebview: uiwebview! override func viewwillappear(animated: bool) { let weburl : nsurl = nsurl(string: menuurl)! let webrequest : nsurlrequest = nsurlrequest(url: weburl) oyebwebview.loadrequest(webrequest); } override func viewdidload() { // super.viewdidload() //super.viewwillappear(yes) // self.viewdidappear(true) let weburl : nsurl = nsurl(string: menuurl)! let webrequest : nsurlrequest = nsurlrequest(url: weburl) oyebwebview.loadrequest(webrequest); //oyebwebview.loadrequest(nsurlrequest(url: nsurl(string: menuurl)!)) // additional setup after loading view. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. }
Comments
Post a Comment