I Have an app which has UIWebView and the Webview contains simple Button
and here's my WebViewController :
import UIKit
class testViewController: UIViewController {
internal static var testID = 0
@IBOutlet weak var myWebView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
let url = NSURL (string: "http://mydomainname/index.html");
let requestObj = NSURLRequest(URL: url!);
myWebView.loadRequest(requestObj);
}
}
And the webView displaying my HTML perfectly
I am just need to present a newViewController from my iOS project when i Click the button in my HTML file ?
like that :
<button onclick="myFunction()> Submit </button>
<script>
function myFunction()
{
presentViewController('myViewControllerName');
}
</script>
is there any way to do that in iOS ?