UISplitViewController master slide in only works after rotation - ios

I am working with a UISplitViewController, and the master is set to be hidden on portrait orientation. In that orientation, the app should open the master view controller with a swipe from left to right gesture.
The problem is that this is not happening unless I rotate the device. If the app starts on landscape, I change to portrait and it works properly (since one rotation was made). If the app starts already on portrait, I need do change to landscape then back.
How can I make it work since the app is opened?

That seems to be the default behavior. Re-setting the delegate upon rotation seems to fix it.

Related

How do you launch an iOS app in the current device orientation?

I'm working with Xamarin and am having troubles launching my app in the current device orientation.
I have a UINavigationController that I set on my main UIWindow as the root controller. I created a custom UINavigationController which overrides the methods :
GetSupportedInterfaceOrientations
and
ViewWillTransitionToSize
If I hold my iPad in landscape mode and start the app, it will start in portrait mode and then rotate in landscape. I'd like to make it start in the same orientation as the device's physical orientation. From the doc I've read it seems that since iOS 8, everything related to rotations should be handled in the root uiview controller which is my custom UINavigationController.
And here's my problem... let's say I want to start my app in the current device's orientation and then block everything except Portrait once the app is loaded. I tried the 2 following solutions and none worked.
1- I put all interface orientations available in the supported interface orientations key in the info.plist file. I launched the app while holding the iPad in landscape mode. In this case, my app starts in the same orientation as the device which is cool. What is not cool is that it doesn't call my navigation controller method GetSupportedInterfaceOrientations anymore. So even if I change the return value of that method to Portrait only later one, it does absolutely nothing since the method is never called anymore.
2- I removed all supported interface orientations from the info.plist file. I lauched the app while holding the iPad in landscape mode. In this case, my app starts in portrait mode and then rotates to landscape. I want to prevent the rotation and just start the app in the current device's orientation (landscape). With this setup though, I can later change the supported orientation as the navigation controller method GetSupportedInterfaceOrientations is being called everytime we try to rotate the app.
In apple's doc, it says "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."
The part where the view rotates to the appropriate orientation PRIOR to showing the window doesn't seem to work for me. It shows the window and then rotates it after.
So how do you launch an app in the current device's orientation (without the user seeing your first view rotate from portrait to whatever) and then be able to change the supported orientations later in the app? Example : I hold my iPad in landscape mode. I launch my app. First view I see is already in landscape mode. I can then rotate my iPad to change the view in portrait/landscape back and forth. Then I click a button which changes the supported orientation to Portrait which prevents me from changing the orientation to Landscape anymore.
Thanks!

iOS 8 rotation hides status bar, iOS 7 works fine

I have an app that I need to restrict one screen to be portrait only. I do this by always returning no in shouldAutoRotate. However, on iOS 8, when I rotate the device, it hides the status bar, but keeps the rest of the view locked to portrait.
In iOS 7, everything works fine. Nothing rotates when I rotate the device any which way.
I've tried disabling rotation system wide, and that works fine, so somehow, in iOS 8, the rotation separately checks for the views and then for the status bar to rotate (or maybe for the navigation controller, which includes the status bar? I'm not sure.)
Any help or ideas as to where to look to get my status bar to also lock to portrait in iOS 8 would be greatly appreciated!
Edit: So, it seems what is going on is that my VC is not rotating, its views are staying the same. However, the status bar orientation is changing from portrait to landscape. I'm figuring this out using NSLogs to check out the orientation, and even though shouldAutoRotate is returning NO no matter what, the status bar is still changing orientation.
Any ideas on how to stop the status bar from also rotating would be great!

iOS 8 Screen slides wrong direction when back button tapped

My application was written for iOS7 and I am trying to get it updated to iOS 8. My application is configured to only work in Landscape Left and Landscape Right orientations.
For iOS 8 I changed the order by which the screens are navigated and changed one of the modal screens to a push transition. On the main screen I have two UIBarButtonItems on the UINavigationItem. Each of these have a push segue assigned to them that connects to different screens.
When the app is running and one of the UIBarButtonItems is tapped, the screen associated through the segue slides over the main screen as expected. The back button is displayed normally. The problem occurs when the back button is tapped. The screen does not slide off to the right as would be expected.
On an iPhone 4 running iOS 7 the screen always slides down (towards the ground) regardless of the devices landscape left or landscape right orientation.
On an iPhone 6 Plus running iOS 8 the called screen quickly rotates to Upside Down (top towards the home button) and then slides off to home button side. Again it doesn't matter which way the phone is oriented landscape left or landscape right orientation.
I have tried setting the preferredInterfaceOrientationForPresentation, shouldAutorotate to NO, and setting the supportedInterfaceOrientations to UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationLandscapeRight. Nothing seems to make any difference at all.
My screen navigation is straight forward, I'm no using any custom transitions. It's all through standard push segues.
I need to get the screen "back" transitions working correctly again.
Any help is greatly appreciated!
I have finally discovered what was causing my screens to slide the wrong direction. It turns out that overriding the supportedInterfaceOrientations method in the UIViewController and returning UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationLandscapeLeft confuses the transition in iOS 8 (and devices running iOS 7 also). This was needed for proper operation in iOS 7, but evidently causes problems in iOS 8. So once I removed the code, the screen transitions began working correctly again.

iOS: Change Orientation only for few pop-up views

I have an app which runs only in Landscape mode. All working well. But I have few pop-up views like Apptentative feedback view and Twitter Sheet view, works great when in portrait mode. So how can I change orientation forcefully when loading these pop-ups and back to landscape when these pop-up closes.
You can't force an orientation change. You can only support changes in orientation. IE moving the device 90 degrees to the right.

Customized navigation bar buttons freezing after stand by

I am having a strange problem.I have used customized navigation bar(for which I have used another ViewController separately) in my project which has ofcourse navigation buttons.
As the device becomes active after stand by,it normally becomes active in portrait mode by default. And if we have held the device in some other orientation,it rotates to that orientation and every thing works fine. Even the navigation bar buttons.
Now here is the problem. If the device is held in Portrait mode after stand by,it freezes the navigation bar buttons. As far as I have concluded,this is because the application gets active in portrait mode by default and since the device is also held in Portrait mode,it can not find any orientation to rotate and hence freezes the buttons.Except navigation bar buttons,everything works fine.And if I rotate the device,like I have said,Everything works fine.
Dont have any idea,why this is happening.Can someone explain?

Resources