Constants
//Best practice is to make a separate .h file only to add this stuff which should be import into pch file.
/**inLine methods are use to check your iOS version like
if ((SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) == NO) {
}
*/
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
//Declare your colour in macros is easy way to access within project
#define AMNavBackgroundColor [UIColor colorWithRed:0.0/255 green:167.0/255 blue:157.0/255 alpha:1.0]
#define AMViewBackgroundColor [UIColor colorWithRed:2.0/255 green:130.0/255 blue:118.0/255 alpha:1.0]
#define AMDarkButtonBackgroundColor [UIColor colorWithRed:27.0/255 green:122.0/255 blue:108.0/255 alpha:1.0]
#define AMLightTextColor [UIColor colorWithRed:255.0/255 green:255.0/255 blue:255.0/255 alpha:1.0]
#define AMBlackTransparentColor [UIColor colorWithRed:0.0/255 green:0.0/255 blue:0.0/255 alpha:0.5]
//Declaring this would stop printing of logs in release mode
#ifdef DEBUG
# define NSLog(...) NSLog(__VA_ARGS__)
#else
# define NSLog(...)
#endif
//Declaring this would stop printing of logs in release mode
#ifdef DEBUG
# define NSLog(...) NSLog(__VA_ARGS__)
#else
# define NSLog(...)
#endif
Comments
Post a Comment