Auto detect restrictions applied after viewing on ios7

I have an autorun issue on ios 7. I am currently working on a project in Xcode 6.1 and screens are created using size classes (compact width, regular height). On iOS 8 everything is fine, but on iOS 7 it looks like the constraints are applied after the view appears (I can see the elements moving to their end positions). When I write a log from iOS 8, from viewDidAppear

and viewDidLayoutSubviews

, I get this order:

 - viewDidLayoutSubviews
 - viewDidLayoutSubviews
 - viewDidAppear,

      

but from iOS 7 the order is like

 - viewDidLayoutSubviews
 - viewDidAppear
 - viewDidLayoutSubviews.

      

Someone had the same problem and is there any solution for this?

Tnx Igor

EDIT:

There was no time to create a test project for this, but after many hours of work I realized that the problem was related to the constraints pinned to the left and right positions of the screen. And this is a problem only for iOs7. So I used a workaround:

check if iOs7 platform, remove constraints pinned to left and right screen positions, and add new constraints with left position and fixed width.

This worked for me, hope it helps someone

+3


source to share





All Articles