Developing for both iPhone and iPad, helpful tips

Use these #defines to make your life easy :
[sourcecode language=”objc”]
#define IS_IPAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define IS_IPAD_LOW_RES ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && [[UIScreen mainScreen] scale] == 1.0)
#define IS_IPHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
[/sourcecode]

Leave a Reply

Your email address will not be published. Required fields are marked *