美文网首页
Xcode热重载神器---InjectionIII

Xcode热重载神器---InjectionIII

作者: 其实你懂De | 来源:发表于2019-06-06 15:33 被阅读0次
神器.png

长着一副针管的样子,对喽,一个UI调试的神器。在我们开发过程中,避免不了重复修改UI,运行Xcode,command+R,可是有的页面可能要点击点击点击...才能看到我们调试的页面,耽误了很长时间。比如我们马上上线,就因为调试一个页面可能机会耽误我们很多时间。还好没放弃,神器来了。
1.首先我们去AppStore去下载这个神器。

2. 屏幕快照 2019-06-06 下午3.23.02.png

点击Open Project 去选择一个项目调试。
3.代码当然要写了在APPDelegate.m

#if DEBUG
    // iOS
    [[NSBundle bundleWithPath:@"/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle"] load];
    // tvOS
    //    [[NSBundle bundleWithPath:@"/Applications/InjectionIII.app/Contents/Resources/tvOSInjection.bundle"] load];
    // macOS
    //    [[NSBundle bundleWithPath:@"/Applications/InjectionIII.app/Contents/Resources/macOSInjection.bundle"] load];
#endif

4.然后在调试页面

  • (void)injected
    {
    //你要修改的UI布局

}


效果图.gif

效果图,这样可以省去很多时间去做很多事情。

相关文章

网友评论

      本文标题:Xcode热重载神器---InjectionIII

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