Note: This framework has been deprecated. It is no longer being actively maintained and will not be updated for future versions of Swift or iOS.
ELHybridWeb is a Swift framework that provides a bridged JavaScript API and web view controller for building hybrid web applications on iOS.
ELHybridWeb requires Swift 5 and Xcode 10.2.
Install manually by adding ELHybridWeb.xcodeproj to your project and configuring your target to link ELHybridWeb.framework from ELHybridWeb
target.
There are two target that builds ELHybridWeb.framework
.
ELHybridWeb
: Creates dynamically linkedELHybridWeb.framework.
ELHybridWeb_static
: Creates statically linkedELHybridWeb.framework
.
Install with Carthage by adding the framework to your project's Cartfile.
github "Electrode-iOS/ELHybridWeb"
Initialize a web view controller and call loadURL()
to asynchronously load the web view with a URL.
let webController = WebViewController()
webController.loadURL(NSURL(string: "foo")!)
window?.rootViewController = webController
To utilize the navigation JavaScript API you must provide a navigation controller for the web view controller.
let webController = WebViewController()
webController.addHybridAPI()
webController.loadURL(NSURL(string: "foo")!)
let navigationController = UINavigationController(rootViewController: webController)
window?.rootViewController = navigationController
See the Platform API documentation for a reference of the JavaScript API. An example web application is available at http://bridgeofdeath.herokuapp.com/ that demonstrates basic web usage of ELHybridWeb.
A test iOS project is located in Example/ELHybridWebExample.xcodeproj that is configured to load the test page at http://bridgeofdeath.herokuapp.com/.