Posts

Showing posts with the label How to store constants in iOS

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...