First, change the color of the status bar:
(1), add in Project Info plist: View controller-based status bar appearance set to NO
(2), in the project Baseviewcontroller inside Add Method:
Set the status bar color to White
if (ios7later) {//Determine if it is IOS7
[[UIApplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent Animated:NO];
}
Second, set the project Launchscreen display time:
How to delegate in app:
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions Add a method to the:
[Nsthread sleepfortimeinterval:3.0];//set Start Page time
Third, the system version judgment method:
The version of the system is judged
#define KSYSVERSION ([[[Uidevice Currentdevice] systemversion] floatvalue])
#define Ios8later (ksysversion >= 8.0f)
#define Ios7later (ksysversion >= 7.0f)
#define Ios6later (ksysversion >= 6.0f)
#define IOS7 (ksysversion >= 7.0f && ksysversion < 8.0f)
Four, obtain the system Appdelegate realizes the Jump method:
Appdelegate * Appdele = (appdelegate *) [uiapplication sharedapplication].delegate;
Tabbarviewcontroller *ghtabbar = [[Tabbarviewcontroller alloc] init];
Homeviewcontroller * HOMEVC = [[Homeviewcontroller alloc] init];
AppDele.window.rootViewController = Homevc/ghtabbar;
Five, the parameter of the macro definition method:
#define COLOR (a,b,c,d) [Uicolor colorwithred:a/255.0 green:b/255.0 blue:c/255.0 alpha:d]
#define SYSTEMFONT (size) [Uifont systemfontofsize:size]
#define Appdelegateinstance ((appdelegate*) ([UIApplication sharedapplication].delegate)
Vi. How to create a PCH file:
(1), create a PCH file first
(2), found in BUiD settings: Apple llvm-language: precompile Prefix Header set it to YES
In the prefix Header, write his absolute path (the absolute path method: Open the terminal. Drag the. pch file from your project into the terminal. And then copy the path).
Write so much first. July 9, 2016 21:53 by Jiang Ailu.
Summarize some of the common small methods in iOS