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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -