3

I've learned the Auto Layout, UITraitCollection and size classes to make adaptive UI. But I understand that I'm missing one thing.

Put it simple: I want my UI stick to home button just like the native camera app does. To do this I specify the constraints string like this "H:[view]-0-|". But the layout of views differ if I launch the app in landscape left and right position. So it means that the information about the size classes is not enough. There is no such thing as landscape left or right in terms of size classes.

There is such a property as UIDevice.currentDevice().orientation. But it is deprecated.

So how in terms of traits and size classes should I determine if the orientation is landscape left or right, so that I can stick my views to the home button?

Grigory
  • 992
  • 2
  • 18
  • 34

1 Answers1

0

Check UIDevice.current.orientation within the viewWillTransitionToSize function. Is is not deprecated.

Oleg
  • 488
  • 4
  • 14
Torsten B
  • 413
  • 2
  • 11