Latest 0.9.5
Homepage https://github.com/XWebView/XWebView
License Apache License, Version 2.0
Platforms ios 8.0, requires ARC
Frameworks WebKit
Authors , , ,

XWebView – eXtensible WebView for iOS

Build Status

Introduction

XWebView is an extensible WebView which is built on top of WKWebView, the modern WebKit framework debuted in iOS 8.0. It provides fast Web runtime with carefully designed plugin API for developing sophisticated iOS native or hybrid applications.

Plugins written in Objective-C or Swift programming language can be automatically exposed in JavaScript context. With capabilities offered by plugins, Web apps can look and behave exactly like native apps. They will be no longer a second-class citizen on iOS platform.

Features

Basically, plugins are native classes which can export their interfaces to a JavaScript environment. Calling methods and accessing properties of a plugin object in JavaScript result in same operations to the native plugin object. If you know the Apache Cordova, you may have the concept of plugins. Well, XWebView does more in simpler manner.

Unlike Cordova, you needn’t to write JavaScript stubs for XWebView plugins commonly. The generated stubs are suitable for most cases. Stubs are generated dynamically in runtime by type information which is provided by compiler. You still have opportunity to override stubs for special cases.

The form of XWebView plugin API is similar to the scripting API of WebKit which is only available on OS X. Although the JavaScript context of WKWebView is not accessible on iOS, the communication is bridged through message passing under the hood.

Besides mapping to an ordinary JavaScript object, a plugin object can also be mapped to a JavaScript function. Calling of the function results in an invocation of a certain native method of the plugin object.

Further more, JavaScript constructor is also supported. A plugin can have multiple instances. In this case, an initializer is mapped to the function of constructor. Meanwhile, principal object of the plugin is created as the prototype of constructor. Each instance has a pair of native and JavaScript object which share the same life cycle and states.

XWebView is designed for embedding. It’s easy to adopt since it’s an extension of WKWebView class. Basically, creating and loading plugin objects are the only additional steps you need to handle. Additionally, XWebView offers 2 threading modes for plugin: Grand Central Dispatch(GCD) and NSThread.

For more documents, please go to the project Wiki.

Minimum Requirements:

  • Development: Xcode 7.3
  • Deployment: iOS 8.0

License

XWebView is distributed under the Apache License 2.0.

Latest podspec

{
    "name": "XWebView",
    "version": "0.9.5",
    "summary": "An extensible WebView (based on WKWebView) for iOS.",
    "description": "XWebView is an extensible WebView which is built on top of WKWebView,nthe modern WebKit framework debuted in iOS 8.0. It provides fast Webnruntime with carefully designed plugin API for developing sophisticatedniOS native or hybrid applications.nnPlugins written in Objective-C or Swift programming language can benautomatically exposed in JavaScript context. With capabilities offerednby plugins, Web apps can look and behave exactly like native apps. Theynwill be no longer a second-class citizen on iOS platform.",
    "homepage": "https://github.com/XWebView/XWebView",
    "license": {
        "type": "Apache License, Version 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "Zhenyu Liang": "[email protected]",
        "Jonathan Dong": "[email protected]",
        "David Kim": "[email protected]",
        "Fernando Martu00ednez": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/XWebView/XWebView.git",
        "tag": "0.9.5"
    },
    "source_files": [
        "XWebView/*.swift",
        "XWebView/XWebView.h"
    ],
    "resources": "XWebView/xwebview.js",
    "frameworks": "WebKit",
    "ios": {
        "frameworks": "MobileCoreServices"
    },
    "requires_arc": true
}

Pin It on Pinterest

Share This