1.預編譯文件信息
#ifndef myDefintion_pch
#define myDefintion_pch
#define Margin 5
#define Padding 10
#define iOS8TopMargin 64 //導航欄44,狀態欄20
//判斷當前的iOS系統是否是8.0及以上系統
#define IOS8_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"8.0"] != NSOrderedAscending )
//判斷當前正在運行的設備是IPhone還是IPad,若是1則爲IPhone
#define isIphone [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone
//自定義顏色
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
#define ButtonHeight 44
//導航欄高度
#define NavigationBarHeight 44
//當前手機屏幕的寬高
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
#ifdef DEBUG
//打印當前信息的所在的文件名(即當前的viewController),當前所在的函數名,當前所在的行號,當前要打印的信息
# define DLog(fmt, ...) NSLog((@"[文件名:%s]\n" "[函數名:%s]\n" "[行號:%d] \n" fmt), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define DLog(...);
#endif
#ifdef __IPHONE_6_0
# define IFLY_ALIGN_CENTER NSTextAlignmentCenter
#else
# define IFLY_ALIGN_CENTER UITextAlignmentCenter
#endif
#ifdef __IPHONE_6_0
# define IFLY_ALIGN_LEFT NSTextAlignmentLeft
#else
# define IFLY_ALIGN_LEFT UITextAlignmentLeft
#endif
#endif /* myDefintion_pch */
//iPhone寬高
//iPhone 4S 3.5寸 320x480
//iPhone 5(//c/s) 4寸 320x568
//iPhone 6(/s/) 4.7寸 375x667
//iPhone 6(/p/sp/) 5.5寸 414x736
//iPhone 7 4.7寸 375x667
//iPhone 7p 5.5寸 414x736