The Ask: I want to have different layouts between Portrait vs Landscape on the iPad. (I'm successful on the iPhone But iPad share similar size classes)
What I've done/Tried:
Reading and searching thru Google and SO, I haven't found the solution. What I did learn was about overriding UITraitsCollection
and If possible, I would like to force the iPad Landscape configuration to follow the same one which I've already set up for the iPhone Landscape mode using hCompact
I tried this solution https://stackoverflow.com/a/60409218/14414215 but unsure where to put it and when just placed within the UIViewController
, when running, the app doesn't even call it. (It's likely cos I don't have my views within a childViewController?)
This post here also references UITraitsCollection
https://stackoverflow.com/a/41374705/14414215 however there is a lack of an example.
I'm fairly sure that this is something that many apps are doing but I'm not able to find the solution.
For reference: This is what I want to achieve on the iPad as well. (iPhone works great using this solution from @DonMag)
StackView layout side by side & on Top of each other (like zStack)