- //-------------------Get device size-------------------------
- //NavBar height
- #define NavigationBar_HEIGHT 44
- //Get screen width and height
- #define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
- #define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
- //-------------------Get device size-------------------------
- //------------------- print log-------------------------
- //Print log in DEBUG mode, current line
- #ifdef DEBUG
- # define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
- #else
- # define DLog(...)
- #endif
- //Rewrite NSLog, print the log and the current number of lines in Debug mode
- #if DEBUG
- #define NSLog(FORMAT, ...) fprintf(stderr,"\nfunction:%s line:%d content:%s\n", __FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
- #else
- #define NSLog(FORMAT, ...) nil
- #endif
- //Print log in DEBUG mode, current line and pop up a warning
- #ifdef DEBUG
- # define ULog(fmt, ...) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [Line %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; }
- #else
- #define ULog (...)
- #endif
-
//ios7 system judgment:
#define IsIOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >=7.0 ? YES : NO)
//Determine whether it is Retina screen, whether it is IPhone5, whether it is IPad
#define isRetina ([UIScreen instancesRespondToSelector:
@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960),
[[UIScreen mainScreen] currentMode].size) : NO)
#define iPhone5 ([UIScreen instancesRespondToSelector:
@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136),
[[UIScreen mainScreen] currentMode].size) : NO)
#define isPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
Common macro definitions for IOS development
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325405797&siteId=291194637
Ranking