Install WebViewJavascriptBridge via CocoaPods
masterTo install the library using CocoaPods, add the following line to your Podfile and run pod install:
pod 'WebViewJavascriptBridge', '~> 6.0'repository·master·Indexed 12 days ago
https://github.com/marcuswestin/webviewjavascriptbridgeAn iOS/OSX library enabling bidirectional message passing between Objective-C and JavaScript within WKWebViews, UIWebViews, and standard WebViews.
To install the library using CocoaPods, add the following line to your Podfile and run pod install:
pod 'WebViewJavascriptBridge', '~> 6.0'To install manually:
WebViewJavascriptBridge folder into your Xcode project.To implement the bridge, follow these five steps:
setupWebViewJavascriptBridge snippet into your JavaScript code to initialize the bridge.setupWebViewJavascriptBridge to access the bridge object.#import "WebViewJavascriptBridge.h"
// Declare property
@property WebViewJavascriptBridge* bridge;
// Instantiate
self.bridge = [WebViewJavascriptBridge bridgeForWebView:webView];
// Register an Obj-C handler
[self.bridge registerHandler:@