GithubHelp home page GithubHelp logo

mrgavinzj / nblwebviewcontrollerdemo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neebel/nblwebviewcontrollerdemo

0.0 1.0 0.0 6.73 MB

A demo for NBLWebViewController's Usage

License: MIT License

Objective-C 81.38% Ruby 12.92% HTML 5.70%

nblwebviewcontrollerdemo's Introduction

NBLWebViewController

NBLWebViewController is a delightful library for loading webpage ,it's based on WKWebView.

NBLWebViewController

Usage:

pod 'NBLWebViewController', '~> 0.0.2'

Subclass NBLWebViewController, and implement methods:

  1. registerMessageHandler

  2. dealWithMessage:(WKScriptMessage *)message

In these methods, you can do your own logic

NBLWebViewController 是一个轻量化的网页加载组件,基于WKWebView,由于WKWebView支持的最低平台为iOS8,所以项目如果需要兼容iOS7, 就要自己使用UIWebView了。

NBLWebViewController提供了加载进度条、返回上一级页面和关闭WebView、JS和OC交互等功能。

如何使用:

pod 'NBLWebViewController', '~> 0.0.2'

新建类继承自 NBLWebViewController,重写registerMessageHandler 和 dealWithMessage:(WKScriptMessage *)message,在这两个方法中可以处理自己的业务逻辑,包括为JS提供原生方法,OC执行JS代码等。注意:在注册MessageHandler时的名称以及具体的参数名称要提前和JS约定好,不然会无法调用。

ps : 如果需要对基类做样式或者逻辑的大改动,你也可以不适用pod的方式集成,直接将项目源文件拖入工程修改使用即可

nblwebviewcontrollerdemo's People

Contributors

neebel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.