IOS Simulator behaving correct? - ios

Starting the IOS Simulator for IPhone 6s does appearing the device in portrait mode.
Then when I rotate the device with Hardware->rotate, then the device rotates, but the content not.
Is this the way in behaves in reality ?
I am asking, because I can't test the rotation correctly.
When I start my app, then things which should be centered appearing not in the center. Should content rotation not be managed by IOS. Do we have to care of these things?
UPDATE
Added a new Scrrenshot.
Good to know that the Iphone's default screen is not rotating.
This leads to the following question :
But is the following correct. When the device is in landscape mode, the app (rotable app) starts in portrait and immediatelly rotates to landscape. So we have to handle the rotation change at start of the app ?

Please goto project ->targets->General goto Deployment Info section and check Device orientation

Related

IOS Launch screen storyboard shows up in different orientation

I have an IOS app built with XCODE 11 which is landscape only(right+left).We are trying to move from Legacy launch images to Story board Launch screen.
The issue seems to be that the new launch screen appears as expected in landscape mode but when the device is in portrait orientation, the launch screen also appears in portrait , which looks weird because the image is meant to be in landscape to match the app orientation.
Note: The app launches in landscape after the launch screen irrespective of how the device is held.
Is there a way to lock the launch screen orientation to match the app (Landscape left+right)?
Been stuck on this issue for a while, appreciate any inputs :)
Have you tried set Supported interface orientations landscape in your info.plist only ?

Is there a way to ensure iPad Simulator landscape screenshots are rotated correctly?

Most of the iPad apps I develop are used in Landscape mode. The iPad Simulator always starts in Portrait mode; with ⌘+R I rotate it to Landscape mode. In the past (before iOS 13.0 or 13.1), screenshots made with ⌘+S had the correct rotation, but if I make a screenshot right now it's rotated by 90 degrees.
(click to enlarge)
This is how the Mac desktop looks like when I make the screenshot on the Simulator:
Is there a way to stop this behaviour? I've tried the menu option Hardware -> Rotate Device Automatically but that didn't help.
This issue seems to have been fixed with the release of iOS 14 / Xcode 12. Now, when I take a screenshot of my Simulator in Landscape mode, it is saved in Landscape orientation.

Is there a way to start iOS app with the initial orientation dynamically?

I know that we can define main orientation in iOS apps. However I couldn't figure out a way to do what I want: If the device is in landscape mode, start the whole application in landscape mode. If not, start it in portrait.
Currently, if I start the application after rotating the device into landscape mode, It opens in portrait mode than it rotates. Is there a way to start the whole app in landscape? (Already rotated window)
Yes; just indicate that you support all device orientations in your info.plist. You can see this in Xcode in your project settings under "General" in Xcode 5.
Quote from Apple's UIViewController documentation:
Note: At launch time, apps should always set up their interface in a portrait orientation. After the application:didFinishLaunchingWithOptions: method returns, the app uses the view controller rotation mechanism described above to rotate the views to the appropriate orientation prior to showing the window.

Interface orientation (Landscape) on iPad weird behaviour on ios 6(xcode 4.5)

I am building a word game app for iPad. I want it to run only in Landscape mode.
1. I have enabled only Landscape in plist settings.
2. The rootview controllers view is also set Landscape.
The issue is when I run it on simulator (ios 6.1), it runs in proper Landscape mode but when I run it on iPad the views are messed up and rotated 90 degree anti clockwise. Do I need to do something else in order to have it run properly on iPad device.

Starting iPad app in current landscape orientation

My ipad app only runs in landscape orientation. But when I test on an actual device (not the simulator) it always seem to start in one particular landscape orientation, then turn 180 degrees to match the current physical landscape orientation. So, it seems to start in LandscapeLeft(I think) then rotate 180 if I have it in LandscapeRight. There's nothing in Info.plist to set the initial orientation.
Can anyone suggest a way to detect current orientation before view loads and set it to correct landscape view before showing?
Thanks
Fitto
There is the UIInterfaceOrientation~iPad key which sets the initial interface orientation on startup.
There is also the UISupportedInterfaceOrientations key which informs the app which orientations are supported.
There is no way, however, to make the app start in the current orientation of the iPad.
Have you looked into these questions?
Get current orientation of iPad?
iPad launch orientation
Also, technically, the iPad should just do it. Make sure you have supported orientations set properly, as I'm sure it checks those to see where it should start.

Resources