iOS-InjectionIII UI效果實時更新

作用

InjectionIII可以讓你更改的UI效果實時的在模擬器上顯示,無需重新啟動應用程序,從而節省開發人員的時間

使用方法

  1. 在 App Store 下載安裝 InjectionIII
  2. 添加相應的代碼
    Xcode10之前:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
#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:@"http://Applications/InjectionIII.app/Contents/Resources/macOSInjection.bundle"] load];
#endif
    
    // Override point for customization after application launch.
    return YES;
}

Xcode10之后:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
#if DEBUG
    // iOS
    [[NSBundle bundleWithPath:@"/Applications/InjectionIII.app/Contents/Resources/iOSInjection10.bundle"] load];
    // tvOS
    [[NSBundle bundleWithPath:@"/Applications/InjectionIII.app/Contents/Resources/tvOSInjection10.bundle"] load];
    // macOS
    [[NSBundle bundleWithPath:@"http://Applications/InjectionIII.app/Contents/Resources/macOSInjection10.bundle"] load];
#endif
    
    // Override point for customization after application launch.
    return YES;
}
  1. 選擇項目文件夾


    image.png

4.在實時顯示的類中添加 代碼

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

5.更改后com+s 保存 模擬器會實時更新效果

效果展示

2019-03-25 10-48-14.2019-03-25 10_56_30.gif
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。