lib/appjam/generators/templates/blank/EiffelApplication/EiffelApplication-Prefix.pch.tt in appjam-0.1.8.8 vs lib/appjam/generators/templates/blank/EiffelApplication/EiffelApplication-Prefix.pch.tt in appjam-0.1.8.9

- old
+ new

@@ -21,9 +21,35 @@ #endif // ALog always displays output regardless of the DEBUG setting #define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); +#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width) +#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height) +#define SAFE_RELEASE(x) [x release];x=nil +#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue] +#define CurrentSystemVersion ([[UIDevice currentDevice] systemVersion]) +#define CurrentLanguage ([[NSLocale preferredLanguages] objectAtIndex:0]) + +#define BACKGROUND_COLOR [UIColor colorWithRed:242.0/255.0 green:236.0/255.0 blue:231.0/255.0 alpha:1.0] + +#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) + +#define GLOBAL_QUEUE(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block) +#define MAIN_QUEUE(block) dispatch_async(dispatch_get_main_queue(),block) + +#define USER_DEFAULT [NSUserDefaults standardUserDefaults] + +#pragma mark - degrees/radian functions +#define degreesToRadian(x) (M_PI * (x) / 180.0) +#define radianToDegrees(radian) (radian*180.0)/(M_PI) + +#pragma mark - color functions +#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1] +#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)] + #ifdef __OBJC__ #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> #endif