Berry Blue
Berry Blue

Reputation: 16512

Expanded split view controller on iPhone 6 plus in portrait

Is it possible to make a split view controller behave the same way on an iPhone 6 Plus as it does on iPad?

So I don't want it to collapse in portrait mode on iPhone 6 Plus but act the same way as it does on iPad when in portrait mode.

Upvotes: 0

Views: 532

Answers (1)

It is: you have to create a VC with a containerView and put the splitView in the container with a embed segue and then override trait collection on the prepare for segue of that view:

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    let trait = UITraitCollection(horizontalSizeClass: UIUserInterfaceSizeClass.Regular)
    setOverrideTraitCollection(trait, forChildViewController: segue.destinationViewController)
}

Upvotes: 1

Related Questions