Showing posts with label Global file Constant Variable. Show all posts
Showing posts with label Global file Constant Variable. Show all posts

Tuesday, December 15, 2015

Global File for iOS Project Development


List of Constant Available for iOS Development



#define APPDELEGATE ((AppDelegate *)[[UIApplication sharedApplication] delegate])
#define dataManager ((DataManager *)[DataManager sharedManager])
#define USERDEFAULT ((NSUserDefaults *)[NSUserDefaults standardUserDefaults])


#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))

#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_RETINA ([[UIScreen mainScreen] scale] >= 2.0)

#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0)
#define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
#define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)

#define showValidationAlert(messageT,title,alertTag) UIAlertView *alert=[[UIAlertView alloc] initWithTitle:messageT message:[NSString stringWithFormat:@"%@",title] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:@"cancel", nil];[alert show];alert.cancelButtonIndex = -1;alert.delegate = self;alert.tag = alertTag;

#define showAlert(messageT,title) UIAlertView *alert=[[UIAlertView alloc] initWithTitle:messageT message:title delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];[alert show];

#define showAlertOkAction(messageT,title) UIAlertView *alert=[[UIAlertView alloc] initWithTitle:messageT message:title delegate:nil cancelButtonTitle:@"OK"otherButtonTitles:nil, nil];[alert show];alert.tag = 102;alert.delegate = self;