Is there a way in Objective-C to quickly get the width and height of the screen of the device I am in?
I tried doing:
CGRect deviceDimension = [[UIScreen mainScreen] bounds];
However in an iPad landscape mode it still gives me 768 as the width and 1024 as the height. Any other idea? Or do I have to just use a macro? Basically I am trying to find a way to replace the following macro:
#ifdef IPHONE
#define SCREEN_WIDTH_PORTRAIT 320
#define SCREEN_WIDTH_LANDSCAPE 480
#else
#define SCREEN_WIDTH_PORTRAIT 768
#define SCREEN_WIDTH_LANDSCAPE 1024
#endif