I\'m creating a Universal application using Swift. I have used Storyboard and Auto-Layouts. Requirement is of creating a universal application which will support Portrait orient
If you are deploying your App to iOS 8 only, then I would use one storyboard. It is simpler to utilize one screen. Here is a link for a great tutorial. http://www.raywenderlich.com/83276/beginning-adaptive-layout-tutorial
If you are like me and want to target down to iOS 6, then I would use separate storyboards. Definitely stick with Auto Layout for whatever you decide to use.
Don't forget we must start supporting 64-bit.
Good luck!
If you want to set this for a specific ViewController (allow all on iPad but only portrait on iPhone) put this into your ViewController-class (Swift 4):
override var supportedInterfaceOrientations:UIInterfaceOrientationMask {
return UIDevice.current.userInterfaceIdiom == .pad ? UIInterfaceOrientationMask.all : UIInterfaceOrientationMask.portrait
}
Go to the info.plist file and add an array with key "Supported interface orientations (iPhone)" and add the following values in it:
Similarly, add another array "Supported interface orientations (iPad)" and add the following:
See below: