1.color
#define COlOR(R,G,B,A) [UIColor colorWithRed:(R)/255.0 green:(G)/255.0 blue:(B)/255.0 alpha:(A)]
2.屏幕大小
#define ScreenBounds [[UIScreen mainScreen] bounds]
//屏幕高度
#define ScreenHeight ScreenBounds.size.height
//屏幕宽度
#define ScreenWidth ScreenBounds.size.width
//导航栏
#define NAVHEIGHT 64
#define TABBARHEIGHT 49
3.版本号
#define VERSION (NSString *)[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
#define SystemVersion [[UIDevice currentDevice] systemVersion]
4.字体
#define SystemFont(fontSize) [UIFont systemFontOfSize:fontSize];
#define SystemBoldFont(fontSize) [UIFont boldSystemFontOfSize:fontSize];
5.
#define MPUserDefaults [NSUserDefaults standardUserDefaults]
#define MPNotificationCenter [NSNotificationCenter defaultCenter]
#define MPAPPLICATION [UIApplication sharedApplication]
#define WINDOW [MPAPPLICATION keyWindow]
6.
#define BUNDLEID (NSString *)[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"]
7.
#define CURR_LANG ([[NSLocale preferredLanguages] objectAtIndex:0])
#define ImageNamed(imgNameStr) [UIImage imageNamed:imgNameStr]
#define StrWithF(S) [NSString stringWithFormat:@"%@",S]
//字符串是否为空
#define StringIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str length] <1? YES : NO )
//数组是否为空
#define ArrayIsEmpty(array) (array == nil || [array isKindOfClass:[NSNull class]] || array.count ==0)
//字典是否为空
#define DictIsEmpty(dic) (dic == nil || [dic isKindOfClass:[NSNull class]] || dic.allKeys ==0)
网友评论