Question, what is the best way to adjust the layout for the iPad in portrait vs landscape?
Michael Sealy Ignites

I see you’ve found your way to this article, which is a good solution if you’re happy with changing your iPad’s horizontal size class in portrait orientation to compact. Of course, this tweak won’t be visible in the storyboard, you’ll have to run it in the simulator or device to see the layout change.

By the way, the code in the article is a little out of date, the following should work in Swift 3 or 4:

override public var traitCollection: UITraitCollection {

if UIDevice.current.userInterfaceIdiom == .pad &&

UIDevice.current.orientation.isPortrait {

return UITraitCollection(traitsFrom: [

UITraitCollection(horizontalSizeClass: .compact),

UITraitCollection(verticalSizeClass: .regular)])


return super.traitCollection