美文网首页
iOS热修复-JSPatch集成

iOS热修复-JSPatch集成

作者: Geek_zheng | 来源:发表于2016-10-25 09:05 被阅读27次

jspatch开源库 github 地址:https://github.com/bang590/JSPatch

导入xcode工程,这里使用到了JavaScriptcore核心库,所以还需要在General的Linde Framework and Libraries添加JavaScriptcore.framework

js文件具体可从服务端动态下载demo.js

有js文件之后执行下面代码

[JPEngine startEngine];
NSString *sourcePath = [[NSBundle mainBundle] pathForResource:@"demo" ofType:@"js"];
NSString *script = [NSString stringWithContentsOfFile:sourcePath encoding:NSUTF8StringEncoding error:nil];
[JPEngine evaluateScript:script];```


集成完毕,具体后续写法  有什么问题的可以留言  一起探讨

相关文章

网友评论

      本文标题:iOS热修复-JSPatch集成

      本文链接:https://www.haomeiwen.com/subject/trnluttx.html