1

At first i was making app for iPad, but then decided to make it universal but after i define screen size, like this :

#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 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_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)

Now on iPad screen size shows up like it was for iPhone, every thing on screen are too small. Is that some kind of bug? or i did something wrong, how can i change it?

artG
  • 235
  • 3
  • 12
  • 1
    Anyone using macros like these is doing it all wrong. – rmaddy Feb 25 '16 at 15:32
  • @rmaddy and whats the good way how to do that? – artG Feb 25 '16 at 15:41
  • 1
    Read the [Adaptivity and Size Changes](https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/TheAdaptiveModel.html) section of the [View Controller Programming Guide for iOS](https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/index.html#//apple_ref/doc/uid/TP40007457). – rmaddy Feb 25 '16 at 15:47

1 Answers1

1

iPad display iPhone parameter , the reason is that app screen size becomes zoom to fit on iPad screen, but actually it capturing iPhone screen size only. To resolve this you need to make your app as Universal. In Xcode->Target->General->Deployment Info->Device Select Universal.

Sachin Kumaram
  • 900
  • 1
  • 10
  • 27