We're supposed to keep away from the centre of the screen when Duo is half-folded (some sort of book / laptop-like pose). How do I do it in a right/intended by UIKit engineers way? Sub-Questions below:
- a) What's the proper way in UIKit, if I only have a frame of region?
- b) How to understand if division region is vertical or horizontal, and where shall i move my controls out of center?
- c) Do we get any layout guides for that?
How do I do it in a right/intended by UIKit engineers way?
Answered here I believe: https://developer.apple.com/forums/thread/847876
a) What's the proper way in UIKit, if I only have a frame of region?
You will have to do the evaluation yourself. Something like this is shown in the "Strike a pose with adaptive layouts on iPhone Duo" talk here in SwiftUI, but the evaluation in UIKit is largely the same:
https://developer.apple.com/videos/play/tech-talks/111463/?time=393
b) How to understand if division region is vertical or horizontal, and where shall i move my controls out of center?
The rect is oriented properly. You can see if it is taller than wide or wider than tall.
c) Do we get any layout guides for that?
No, Reserved Regions is the API to use for manual layout.
This is incidentally why our recommend in the video and elsewhere is to prefer solutions like ArrangementViews where at all possible, as they handle this evaluation for you.