IOS Snippet

  1. Config Background Color of Statue Bar
+ (void)configStatusBarBackgroundColor:(UIColor *)color {
    UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
  
    if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
        statusBar.backgroundColor = color;
    }
}
  1. Add PCH
    Build Settings -> Prefix Header
$(SRCROOT)/[ProjectName]/[PCH_file_name].pch

你可能感兴趣的:(IOS Snippet)