Giter Club home page Giter Club logo

imywebview's Introduction

IMYWebView

UIWebView seamless switching to WKWebView
无缝切换 UIWebView 为 WKWebView

##要求

  • ARC only

##使用方法

直接把你项目中的 'UIWebView' 名称替换为 'IMYWebView'

##在原框架基础上,添加了js回调oc的相关方法,用法如下

/**
 *  iOS8下 本地注册js方法,让服务端调用
 */
- (void)addJsMethodIniOS8
{
    WYScriptMessageHandlerLeakAvoider *leakAvoider = [[WYScriptMessageHandlerLeakAvoider alloc] initWithDelegate:self];
    [_co_webView addScriptMessageHandler:leakAvoider name:@"closeMe"];
}

在当前类selfdealloc里面调用下面的方法:

/**
 *  iOS8下 注销 本地注册的js方法
 */
- (void)removeJsMethodIniOS8
{
    [_co_webView removeScriptMessageHandlerForName:@"closeMe"];
}

imywebview's People

Contributors

li6185377 avatar wangyangcc avatar

Watchers

 avatar  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.