Here is my Swift
func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {
if (navigationType == UIWebViewNavigationType.formSubmitted) {
let VC = self.storyboard?.instantiateViewController(withIdentifier: "UITabBarController") as? UITabBarController
let navigationController = UINavigationController(rootViewController: VC!)
self.navigationController?.present(navigationController, animated: true, completion:nil)
}
return true
}
And here is my HTML file that is loaded in webView
<html>
<head>
<script>
function myFunction()
{
presentViewController('UITabBarController');
}
</script>
</head>
<body>
<input name="myFunction" type="submit" onClick="myFunction" value="myFunction">
</body>
</html>
This just not working, any advise? I don't mind if it's a link instead of a button also.
It's webView inside viewcontroller, after clicking the Link/button, it will present a next viewcontroller which has tabbar.