Hier ist mein SwiftWie präsentiere ich einen ViewController von einem Klick in WebView? Swift/Xcode
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
}
Und hier ist meine HTML-Datei, die in webView
<html>
<head>
<script>
function myFunction()
{
presentViewController('UITabBarController');
}
</script>
</head>
<body>
<input name="myFunction" type="submit" onClick="myFunction" value="myFunction">
</body>
</html>
Diese einfach nicht funktioniert, jede Beratung geladen wird? Es macht mir nichts aus, wenn es auch eine Verknüpfung statt einer Schaltfläche ist.
Es ist WebView innerhalb ViewController, nach dem Klicken auf den Link/Button, wird es einen nächsten Viewcontroller, der Tabbar hat.