In my app, I have a webview, and I would like to have a button that will open another view in Swift. Is there a way to use have that button in the webview itself and use javascript to have it segue to the next view? If so, how can I implement this?
2
-
You might want to check stackoverflow.com/questions/26573528/… OR stackoverflow.com/questions/41996624/…Ahmad F– Ahmad F2017-03-18 18:59:56 +00:00Commented Mar 18, 2017 at 18:59
-
Both of those involve using javascript in WebViews, but I'm not sure how they relate to my specific question. Thank you for the information, though.rustbird– rustbird2017-03-18 20:19:03 +00:00Commented Mar 18, 2017 at 20:19
Add a comment
|
1 Answer
Use webViewJavaScript bridge classes and use it functions and web view delegate methods for interacting.
objective C link https://github.com/lokimeyburg/WebViewJavascriptBridge
for swift use it by simply importing #import "WebViewJavascriptBridge.h" in your AppName-bridging-header.h
1 Comment
rustbird
Thank you! I've never created anything with bridges, though, so I'm not 100% sure how to implement this. Do you have any tips/links to good guides?