ios常用宏定义

来源:互联网 发布:生物医学数据挖掘 pdf 编辑:程序博客网 时间:2024/04/28 21:34

#define ZLZIOS7   ([[[UIDevice currentDevice].systemVersion doubleValue] >= 7.0])
#define ZLZIPHONE5    (([[UIScreen mainScreen] bounds].size.height)>=568)
#define ZLZScreenHeight ([UIScreen mainScreen].applicationFrame.size.height)
#define ZLZScreenWidth  ([UIScreen mainScreen].applicationFrame.size.width)
#define ZLZColorRGB(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define ZLZColorRGBA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define RectX(rect)                            rect.origin.x
#define RectY(rect)                            rect.origin.y
#define RectWidth(rect)                        rect.size.width
#define RectHeight(rect)                       rect.size.height
#define ZLZRectSetWidth(rect, w)                  CGRectMake(RectX(rect), RectY(rect), w, RectHeight(rect))
#define ZLZRectSetHeight(rect, h)                 CGRectMake(RectX(rect), RectY(rect), RectWidth(rect), h)
#define ZLZRectSetX(rect, x)                      CGRectMake(x, RectY(rect), RectWidth(rect), RectHeight(rect))
#define ZLZRectSetY(rect, y)                      CGRectMake(RectX(rect), y, RectWidth(rect), RectHeight(rect))
#define ApplicationDelegate                 ((AppDelegate *)[[UIApplication sharedApplication] delegate])
#define ZLZUserDefaults                        [NSUserDefaults standardUserDefaults]
#define ZLZNotificationCenter                  [NSNotificationCenter defaultCenter]
#define ZLZSharedApplication                   [UIApplication sharedApplication]
0 0
原创粉丝点击