Reputation: 61
I’’ve been developing an iPhone app in swift 4 and I’m about to start a new version for iPad too
My client has specially requested that the app’s GUI is built in code and not using storyboard, so I was wondering what’s the best approach in this case. Adaptive layout works well when working with storyboard, also gui designs are way too different for both versions, it’s not just a matter of resizing
Please any suggestions ?
Upvotes: 0
Views: 42
Reputation: 535138
Get UIScreen.current.traitCollection.userInterfaceIdiom
. It will be .phone
or .pad
. Use if
to proceed accordingly with the construction of the interface.
Upvotes: 3