ios - WebViewController - display -


i have created webviewcontroller view, displays websites in menu. have 2 cells, contact us, on click of cell shows web view contact , terms of use displays terms .

my question how write code uses 1 of controller.

// controller display web

class webviewcontroller: uiviewcontroller {      @iboutlet weak var webview: uiwebview!      var urltoshow:string?      override func viewdidload() {         super.viewdidload()          if let url = urltoshow {             webview.loadrequest(nsurlrequest(url: nsurl(string: url)!))         }     } } 

you should use sfsafariviewcontroller instead of webviewviewcontroller.

if ([sfsafariviewcontroller class] != nil) {         sfsafariviewcontroller *sfvc = [[sfsafariviewcontroller alloc] initwithurl:url];         sfvc.delegate = self;         [self presentviewcontroller:sfvc animated:yes completion:nil];     } else {         if (![[uiapplication sharedapplication] openurl:url]) {             //nslog(@"%@%@",@"failed open url:",[url description]);         }     } 

pass different url contact , privacy policy. open website in looks navigated in application. thanks


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

jaxb - Use JAXWS enableWrapperStyle while generating Java source with XJC -