IOS 7.1, Regular width limits on the universal storyboard are ignored if the target device family is installed on the iPad

I started a new project with one view on Xcode 6.1
went to my goal and installed the Device Family for universal and for deployment up to 7.1

In the storyboard, I placed a red mark in the size class Regular Width | Any Height Regular Width | Any Height and blue mark in the Compact Width | Any Height dimension class Compact Width | Any Height Compact Width | Any Height

According to the documentation, I should see a red mark when working on the ipad and blue on the iphone, While this works both in the simulator and on real devices.

Now I’ve returned to the goal and installed the Device Family on the iPad , running the application again:

  • IPad 2 (7.1) on the simulator - red mark

  • IPad 2 (7.1) (real device) - blue mark ?!?!?

  • IPad 2 (8.1) (real device) - red mark

The same goes for the iPad Air / iPad mini and all the other iPad with iOS 7.1, I came across

Basically, I see that on the universal storyboard, when setting up the device family for the iPad in ios 7.1, the storyboard is considered compact. I have to be compatible with iOS 7.1 and my application will be released only for iPad. Does anyone know how to fix this?

Edit

According to Apple Documentation : For applications that support versions of iOS earlier than iOS 8, most size classes are backward compatible. Classes are backward compatible while

  • Application built using Xcode version 6 or later

  • Application deployment goal higher than iOS 8

  • Dimension types are listed in storyboard or xib

  • The height component value is not compact

All of the above applies to my example.

+6
source share
2 answers

SIMULATOR VS. DEVICE? I was able to reproduce the problem that you are reporting in the simulator.

I think you assume that your simulator is working correctly, because it leads to the expected output, and it is the iPad that displays the “wrong” layout. However, it’s worth considering whether the iPad really displays the standard output for your configuration, even if this output is an error. A preview of the Storyboard in Xcode shows the correct behavior for the configuration, but it is incorrect in the simulator for iPad 2 (7.1) and valid for other iPad models, as well as when working with iOS 7.1. The expected behavior is observed for iOS 8.x in the simulator. Therefore, this is not a simulator and device problem. I suspect that the reason you saw different results in your simulator was because you didn’t do a clean build, as some critical changes caused this, so it still used the old XIB as it cached longer than they should be sometimes.

REASONS FOR THE ROOM? You configure the device family of your project to target only the iPad, but include the Compact Width | Any Height size class in your storyboard. Compact Width | Any Height , a size class that the iPad should never use. This may be the configuration aspect causing this problem. However, this should not happen anyway. This issue occurs both with Xcode 6.1 and does not differ in the current beta version 6.2.

A specific aspect of your current configuration may arise that triggers this. In particular, automatic layout and target devices depend on launch screens in some documentary, but often unexpected, developers. (For example, using the storyboard for the launch screen will quietly make your application accessible everywhere, even if you indicated that it should be only for the iPhone for your purpose.) There are other cases (see this question and the question of stack overflow ) where migration Image run in a different configuration resolved similar problems. So worth a try.

0
source

I tried to compare the intermediate files created in the xcode build folder, but as far as I can tell that there is no dependency on the device under test (this means that as long as I set the deployment target to 7.1, it doesn't matter which platform this will eventually be deployed) Therefore, I tend to think that this is not a bug in xcode or ios 7.1, but really just not backward compatibility for this particular scenario.

I filed an error for Apple's technical support, but still have not received any replay from them. It seems like at this point a workaround would be to set all Regular width constraints to Any width and remove the Compact width constraints. And as soon as the application is released for the iPhone, discard this change.

0
source

Source: https://habr.com/ru/post/978148/


All Articles