I Have an app which has UIWebView and the Webview contains simple Button
and here\'s my WebViewController :
import UIKit
class testV
You can assign a scheme in the js action:
window.location = yourscheme://
and in swift layer you can use the callback:
func webView(webView: UIWebView!, shouldStartLoadWithRequest request: NSURLRequest!, navigationType: UIWebViewNavigationType) -> Bool {
if (request.URL.scheme == "yourscheme") {
// Your code
}
return true;
}