zkrige / EasyJSWKWebView

WKWebView implementation of EasJSWebView Javascript bridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EasyJSWKWebView

Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

<html>
<body><br/><br/><br/><input value="Press Me" type="button" onclick="JSInterface.test();"></body>
</html>
public class ClickCatcher : NSObject {
	public func test() -> String{
        return "Clicked"
    }
}


let interfaces = ["JSInterface" : ClickCatcher()];
webview = EasyJSWKWebView(frame: view.bounds, configuration: config, withJavascriptInterfaces: interfaces)

Requirements

iOS8+

Installation

EasyJSWKWebView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "EasyJSWKWebView"

Swift

This library uses OBJC functions that are not transportable to SWIFT. If you are using this with swift, remember to tag your methods @objc so that the objc invoker can find them

Author

Zayin Krige, zkrige@gmail.com

License

EasyJSWKWebView is available under the MIT license. See the LICENSE file for more info.

About

WKWebView implementation of EasJSWebView Javascript bridge

License:MIT License


Languages

Language:Objective-C 82.2%Language:Ruby 7.5%Language:JavaScript 7.4%Language:HTML 2.9%