一 关于屏幕大小
#pragma mark - 屏幕宽高 #define SCREEN_BOUNDS ([UIScreen mainScreen].bounds) #define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width) #define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
二 关于application
#pragma mark - UIApplication #define kAppDelegate ([[UIApplication sharedApplication] delegate]) #define kAppWindow (kAppDelegate.window)
三 关于颜色
#pragma mark - RGB颜色 ///------ 10进制 ------ #define RGBA(r, g, b, a) ([UIColor colorWithRed:(r)/255. green:(g)/255. blue:(b)/255. alpha:a]) ///------ 16进制 ------ #define HEXCOLOR(hex, a) [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16)) / 255.0 green:((float)((hex & 0xFF00) >> 8)) / 255.0 blue:((float)(hex & 0xFF)) / 255.0 alpha:a] ///------ 随机颜色 ------ #define RandomColor ([UIColor colorWithRed:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0 alpha:1])
四 关于字体
#pragma mark - 字体大小(常规/粗体) #define BOLDSYSTEMFONT(FONTSIZE) [UIFont boldSystemFontOfSize:FONTSIZE] #define SYSTEMFONT(FONTSIZE) [UIFont systemFontOfSize:FONTSIZE] #define FONT(NAME, FONTSIZE) [UIFont fontWithName:(NAME) size:(FONTSIZE)] ///------ 系统默认10~20号字体 ------ #define SYSTEMFONT_10 SYSTEMFONT(10) #define SYSTEMFONT_11 SYSTEMFONT(11) #define SYSTEMFONT_12 SYSTEMFONT(12) #define SYSTEMFONT_13 SYSTEMFONT(13) #define SYSTEMFONT_14 SYSTEMFONT(14) #define SYSTEMFONT_15 SYSTEMFONT(15) #define SYSTEMFONT_16 SYSTEMFONT(16) #define SYSTEMFONT_17 SYSTEMFONT(17) #define SYSTEMFONT_18 SYSTEMFONT(18) #define SYSTEMFONT_19 SYSTEMFONT(19) #define SYSTEMFONT_20 SYSTEMFONT(20) #define SYSTEMFONT_21 SYSTEMFONT(21) #define SYSTEMFONT_22 SYSTEMFONT(22) #define SYSTEMFONT_23 SYSTEMFONT(23) #define SYSTEMFONT_24 SYSTEMFONT(24)
五 关于内联函数
#pragma mark - 静态内联函数 #define RYJKIT_STATIC_INLINE static inline
六 关于沙盒路径
#pragma mark - 沙河路经 #define PathUserDefaults [NSUserDefaults standardUserDefaults] #define PathTemp NSTemporaryDirectory() #define PathDocument [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] #define PathCache [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]