I have used this code to get screen width and screen height,
float scaleFactor = [[UIScreen mainScreen] scale];
CGRect screen = [[UIScreen mainScreen] bounds];
CGFloat widthInPixel = screen.size.width * scaleFactor;
CGFloat heightInPixel = screen.size.height * scaleFactor;
NSLog(@"%f",widthInPixel);
NSLog(@"%f",heightInPixel);
and
CGRect screenBounds = [[UIScreen mainScreen] bounds];
NSLog(@"screenBounds W %f",screenBounds.size.width);
NSLog(@"screenBounds H %f",screenBounds.size.height);
But its showing same width= 768 and height=1024 for both the portrait and landscape mode..