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 orientation only for iPhone and Landscape orientation only for iPad.
I have developed UI for iPhone and now I will be starting iPad UI.
Also UI created for iPhone is not same as UI created for iPad, both UI's are quite different.
I'm thinking of to create separate storyboards for iPhone and iPad. Is there any proper way to achieve this?
Answer: A: For compatible Apps that are intended for iPhone, iPadOS15 will now automatically rotate the App to display in Landscape screen orientation. There is no manual configuration or setting to enable this feature.
Make sure that Rotation Lock is off: Swipe down from the top-right corner of your screen to open Control Center. Then tap the Rotation Lock button to make sure it's off.
Some Apps may only support one or other screen mode - and will always launch in this mode if the other is not supported. Where both screen modes are supported by an App, then they should open in the orientation determined by the physical position of the iPad - as determined by the internal sensors of the device.
Check Rotation Lock On an iPhone with a Home button, swipe up from the bottom of the screen to access it. On an iPhone without a Home button, swipe down from the top-right corner of the screen instead. Here, tap on the rotation lock icon (which looks like a lock with a circular arrow) to turn it on or off.
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:
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 love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With