SCLMacros.h 1.3 KB

123456789101112131415161718192021222324252627
  1. //
  2. // SCLMacros.h
  3. // SCLAlertView
  4. //
  5. // Created by Diogo Autilio on 10/03/15.
  6. // Copyright (c) 2015-2017 AnyKey Entertainment. All rights reserved.
  7. //
  8. #ifndef SCL_MACROS_H
  9. #define SCL_MACROS_H
  10. #define UIColorFromHEX(rgbValue) [UIColor \
  11. colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
  12. green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
  13. blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
  14. #define DEGREES_TO_RADIANS(degrees) ((M_PI * degrees)/ 180)
  15. #define TIMER_STEP .01
  16. #define START_DEGREE_OFFSET -90
  17. #define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
  18. #define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
  19. #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
  20. #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
  21. #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
  22. #endif