|
|
@@ -44,6 +44,41 @@
|
|
|
#define IS_IPHONE_6 CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(375, 667.0f)) || CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(667.0f, 375))
|
|
|
#define IS_IPHONE_6P CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(414, 736.0f)) || CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(736.0f, 414))
|
|
|
|
|
|
+#define USERDEFAULT [NSUserDefaults standardUserDefaults]
|
|
|
+#define SharedApplication [UIApplication sharedApplication]
|
|
|
+#define Bundle [NSBundle mainBundle]
|
|
|
+#define MainScreen [UIScreen mainScreen]
|
|
|
+#define BundleInfo [Bundle infoDictionary]
|
|
|
+#define AppVersion [BundleInfo objectForKey:@"CFBundleVersion"]
|
|
|
+#define DeviceLangCode [[NSLocale preferredLanguages] objectAtIndex: 0] //시스템 언어정보 코드
|
|
|
+
|
|
|
+#define ViewWidth(v) v.frame.size.width
|
|
|
+#define ViewHeight(v) v.frame.size.height
|
|
|
+#define ViewX(v) v.frame.origin.x
|
|
|
+#define ViewY(v) v.frame.origin.y
|
|
|
+
|
|
|
+#define ViewRectSetXY(v, x, y) CGRectMake(x, y, ViewWidth(v), ViewHeight(v))
|
|
|
+#define ViewRectSetX(v, x) CGRectMake(x, ViewY(v), ViewWidth(v), ViewHeight(v))
|
|
|
+#define ViewRectSetY(v, y) CGRectMake(ViewX(v), y, ViewWidth(v), ViewHeight(v))
|
|
|
+
|
|
|
+#define RectMake(x, y, w, h) CGRectMake(x, y, w, h)
|
|
|
+
|
|
|
+#define RectX(f) f.origin.x
|
|
|
+#define RectY(f) f.origin.y
|
|
|
+#define RectWidth(f) f.size.width
|
|
|
+#define RectHeight(f) f.size.height
|
|
|
+
|
|
|
+#define RectSetWidth(f, w) CGRectMake(RectX(f), RectY(f), w, RectHeight(f))
|
|
|
+#define RectSetHeight(f, h) CGRectMake(RectX(f), RectY(f), RectWidth(f), h)
|
|
|
+#define RectSetX(f, x) CGRectMake(x, RectY(f), RectWidth(f), RectHeight(f))
|
|
|
+#define RectSetY(f, y) CGRectMake(RectX(f), y, RectWidth(f), RectHeight(f))
|
|
|
+#define RectSetSize(f, w, h) CGRectMake(RectX(f), RectY(f), w, h)
|
|
|
+#define RectSetOrigin(f, x, y) CGRectMake(x, y, RectWidth(f), RectHeight(f))
|
|
|
+
|
|
|
+#define getCenter(v) CGPointMake(v.center.x-ViewX(v), v.center.y-ViewY(v))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
#define IS_IPAD [[[UIDevice currentDevice] systemVersion] floatValue] >= 8.3 ? (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) : [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad
|
|
|
#define AUTO_NIB(NIB_NAME) IS_IPAD?[NSString stringWithFormat:@"%@_iPad", NIB_NAME]:IS_4INCH_SCREEN?[NSString stringWithFormat:@"%@_4Inch", NIB_NAME]:NIB_NAME
|