SkillAgentSearch skills...

JsWebView

An iOS bridge between Objective-C and JavaScript.

Install / Use

/learn @app-bootstrap/JsWebView
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

JsWebView

Preview

preview

Usage

Installation

copy JsWebViewController.h, JsWebViewController.m into your project.

Add the following import to the top of the file:

#import "JsWebViewController.h"

Configuration

JsWebViewController *view = [[JsWebViewController alloc] init];
...
view.url = url;

Usage

var callback = function() {

  $('#pushView').addEventListener('click', function() {
    JSBridge.invoke('pushView', {
      url: 'index.html'
    });
  }, false);

  $('#popView').addEventListener('click', function() {
    JSBridge.invoke('popView');
  }, false);

  $('#setTitle').addEventListener('click', function() {
    JSBridge.invoke('setTitle', 'newTitle');
  }, false);
};

document.addEventListener('JSBridgeReady', function() {
  callback();
}, false);

License

The MIT License (MIT)

Copyright (c) 2015 xdf

Related Skills

View on GitHub
GitHub Stars17
CategoryDevelopment
Updated6y ago
Forks2

Languages

Objective-C

Security Score

75/100

Audited on Aug 18, 2019

No findings