Middleware for objective-c and JavaScript to communicate with each other

Source: Internet
Author: User

Git address: Http://git.oschina.net/feiji1hao/NZOCJSBridge

Project is a middleware that provides objective-c and JavaScript communication for hybrid development

Simply copy the catalog Nzocjsbridge to your project and bring your demo with you, and familiarize yourself with the examples before use.

For easy reading and use, only two main APIs are available and need to be self-expandable

First, OC sends a message to JS and callbacks

[_bridge send:@ "OC send String to JS" responsecallback:^ (ID response)    {NSLog (@ "OC got response:%@", response); }];

Second, JS send a message to OC and callback

Bridge.send (' JS send String to OC ', function (responsedata) {console.log (' JS got response ', ResponseData)})

Note: Only the item is Webviewjavascriptbridge's thumbnail version

Middleware for objective-c and JavaScript to communicate with each other

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.