Trait and size changes together

Originator:douglashill
Number:rdar://23263181 Date Originated:26-Oct-2015 08:18 PM
Status:Open Resolved:
Product:iOS SDK Product Version:
Classification: Reproducible:
 
Summary:
UIKit provides the methods viewWillTransitionToSize and willTransitionToTraitCollection, but sometimes I want to do something that depends on both the future size and trait collection. For example, we want to use two columns only in a regular × regular size class where the width is greater than the height.

We can of course ignore UIKit’s size classes and define our own size thresholds, but this is not always desirable.

Steps to Reproduce:
Try to do something that depends on both the future size and trait collection.

Expected Results:
Maybe some API that provides both the future size and trait collection, or a way to get the size class from a width or height.

Actual Results:
No such API that I know of. I went with defining my own thresholds and investigating what UIKit does to ensure they match.

Version:
iOS 9, Xcode 7.1 (7B91b)

Notes:


Configuration:
N/A

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!