美文网首页iOS开发iOS开发
Xcode快速预览插件--injectionforxcode

Xcode快速预览插件--injectionforxcode

作者: Lee_dev | 来源:发表于2016-03-16 14:02 被阅读539次
简介

做 iOS 开发的都知道,当我们写UI时经常要重复编译工程查看效果,每一次的重新编译累计起来浪费了我们大量的时间。injectionforxcode这个插件可以快速帮助我们实现预览效果,无须重启应用。

先上效果图
image
安装方法

1、通过 Alcatraz 安装

iamge

2、

 2.1 、git clone https://github.com/johnno1962/injectionforxcode.git 
 2.2 、编译 InjectionPluginLite/InjectionPlugin.xcodeproj
    
使用方法

在你修改完代码后按下面的组合健即可

shift + control + =        //(以MBP为例,shift健 + control健 + 等于号)

你也可以监听Injection的回调方法(可选)

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(injected) name:@"INJECTION_BUNDLE_NOTIFICATION" object:nil];

- (void)injected
{
   NSLog(@"I've been injected: %@", self);
}

原理图
image
相关链接:

作者twitter :@orta

GitHUb :https://github.com/johnno1962/injectionforxcode

作者亲自录的教程 :https://www.youtube.com/watch?v=uftvtmyZ8TM&feature=youtu.be

Demo :https://github.com/lioonline/Injection4XcodeDemo

相关文章

网友评论

    本文标题:Xcode快速预览插件--injectionforxcode

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