ios - How to implement delegate for open source browser SVWebViewController? -
i understand ios uiwebview
can implement uiwebviewdelegate
, access method required.
however custom browser svwebviewcontroller, confused how implement delegate method tried implementing uiwebviewdelegate
above , did not work (the "load" message not showing @ all).
class tableinfo: uitableviewcontroller, mwfeedparserdelegate, ensidemenudelegate,uiwebviewdelegate{ var allowload = true func webview(webview: uiwebview, shouldstartloadwithrequest request: nsurlrequest, navigationtype: uiwebviewnavigationtype) -> bool { println("load") return allowload } func webviewdidfinishload(webview: uiwebview) { allowload = false } } override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { if hasinternet { let item = self.items[indexpath.row] mwfeeditem let url = nsurl(string: item.link) let con = svwebviewcontroller(url: url) self.navigationcontroller?.pushviewcontroller(con, animated: true) } }
Comments
Post a Comment