Ios app strange rotation behaviour after iOS 8 SDK update - ios

I've been developing an iPad app which was working fine until i updated my Xcode to version 6 and my iPad to iOS 8.The problem i am encountering now is that when i change the orientation of my iPad i can catch the event but the views do not rotate accordingly.To be specific in my iPad with iOS 7 app rotates itself size of the views stay the same; for example if i start the app in portrait mode and change rotation to landscape there is a space on the right side of the uiview.In my iPad with IOS 8 views do not even rotate itself and stay the same all the time.I'm not using auto layout and app used to work like charm before IOS 8 SDK release.I need your help on finding articles and cause of the problems.Thanks in advance
probably the cause of problem is this line but i need to have this because otherwise my app won't release uiwebview from memory.
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
self.view.window.rootViewController=self;
}

Rotation handling has changed in iOS 8. Methods such as willRotateToInterfaceOrientation:duration: and didRotateToInterfaceOrientation: are now deprecated and replaced by viewWillTransitionToSize:withTransitionCoordinator:. Depending on how you're handling rotations in your app, you may have to make changes in your code to adapt to the new methods. Check chapter "Handling view rotation" in the UIViewController reference docs

Related

Transform making UIView disappear on iPhone 6 device

I have the weirdest problem specific to a iPhone 6 device. It's related to doing transform on a UIView.
If I do something like this on my UIView:
view.transform = CGAffineTransformMakeRotation(3.14/10)
Then the view disappears entirely. On my iPhone 5, then the view rotates as it should, but on the iPhone 6 it disappears entirely.
Any animation using transform also works perfectly on my iPhone 5 but on my iPhone 6 it doesn't show and sometimes shows "sharded" views of what I'm trying to animate.
This is iPhone 6 specific and only occurs on the device and NOT in the simulator.
Any suggestions on what this could be about?
It seems likely that something is using the frame of the view, which is undefined when you have a non-identify transform. For example, there might be a layoutSubviews method or constraint which is interacting badly with your view (It's better in iOS 8, but perhaps you ran into a yet-unsolved case). It's hard to tell what exactly is going on since you didn't supply a completely example.
You might try a tool like Xcode's view inspector or Reveal which can show you where your view is ending up and what constraints are acting on it. If that's not instructive, you should make a minimal example and post it.
It could also be differences in iOS version. Do your devices and simulators share the same point release?
It ended up being RubyMotion specific, so sorry for posting it with iOS tags - http://community.rubymotion.com/t/transform-making-uiview-disappear-on-iphone-6-device/344/4.

Touch controls working for iOS 7,6,5... but not for iOS 8

I developed a OpenGL ES game several years ago and works well until now: I have downloaded Xcode 6 and iOS 8 in my iPad 3, and touch control (touchesBegan, touchesMoved, touchesEnded) only detect a square of 768x768 points, instead of 1024x768.
A margin of 256 points (1024-768) not respond to pulsations.
The game is in landscape mode.
It seems as if the touch control think that iPad is in portrait mode instead of landscape mode. Visually it is in landscape.
Looks like a bug in iOS 8.
Finally figured this out if anyone is still dealing with this - it looks like iOS 8 causes some problems when adding a UIView directly to the window in the app delegate. I had to create a UIViewController, add the UIView to that, and then make it the root view controller.

Interface cut jumps on load in simulator and iOS 8, but not on iOS 7 real device

I have a problem with my interface on iOS 8 GM(real 5s) and iOS 8 Simulator(iPhone 5, 5s, 6 and 6+).
When I'm testing the app and I load my custom player view controller, the interface make a jump when interface is shown. And when testing on real app, instead of jump MPVolumeView is appearing in a some kind of expanding animation.
However, the problem is not there when I'm testing it on iOS 7 iPhone(the real one).
Also I've found out that if I remove all the constraints from the view that is loaded the jump issue disappears.
May it be a bug in iOS 8 behavior? Or it is some new behavior that I'm getting wrong?
EDIT: Testing on iOS 7 simulator definitely makes it look like it's some new behavior of iOS 8(on iOS 7 it works fine).
Here is the video for better understanding of the problem:
(black bar is MPVolumeView)
http://www.youtube.com/watch?v=gfc3n2syqo4
Okay, I've figured it out.
For some reason, if you set constraint from the view to the bottom layout guide, the view will jump on load. Don't know if this is expected behavior, I think I will post bug report for this one.
TL;DR remove bottom layout guide constraint and use other constraints.

Black bar on IOS 7

I have an iPad app. When I used it in iOS 5 or 6 its working fine and the UI also seems to be fine. But the same in iOS 7 a black bar on top, bottom, left and right of the screen appeared. Including on the splash screen.
I had tried it by hiding status bar of all views.But I cant fix the issue.
- (BOOL)prefersStatusBarHidden
{
return YES;
}
Can any one know what is the reason?
The same thing happened to me as a result of downloading the latest version of Xcode
and all I had to do was adjust the frame of my view as it was altered during the download. It's so simple I didn't even think to try it.
How big are the bars? Is there any chance this is actually an iPhone retina app and this is iOS 7's new automatic scaling for the iPad's bigger display instead of the old '2x' mode?
Also, does it behave like this in the simulator and if so, can you post simulator shots of it running under iOS 6 and iOS 7?
See here for what I mean : http://www.iphonehacks.com/2013/07/ios-7-uses-retina-assets-of-iphone-only-apps-on-non-retina-ipad.html

Accelerometer data reversed in iphone 5?

I'm creating a cocos2d game on iOS that uses the accelerometer. I just started testing on an iphone 5 and for some reason, it's reversing the accelerometer data - basically it behaves as if the screen orientation is 180 degrees flipped from how it actually is, tilting down causes it to send things up, left goes right etc.
It works fine on my iphone 4 running iOS 5 and on both my ipad running iOS 5 and my ipad running iOS 6. Not sure if it's an issue with just the iphone 5 or all iphones running iOS 6.
I can't find any mention of this issue online, wondering if anyone else is running into this and if you know of a solution.
OK I figured out what was going on. In iOS 6 the willRotateToInterfaceOrientation method is deprecated and no longer gets called. I had code in there to do two things - detect which landscape orientation the phone was loading into and adjust the variables accordingly, and to prevent the phone from flipping the orientation during gameplay (it's a tilt-to-move game). The reason everything was behaving as if the view was upside-down was because it was, and the phone's orientation was locked, and my code to correct for that wasn't being called. Here's what Apple says about willRotateToInterfaceOrientation:
The willRotateToInterfaceOrientation:duration:,
willAnimateRotationToInterfaceOrientation:duration:, and
didRotateFromInterfaceOrientation: methods are no longer called on any
view controller that makes a full screen presentation over itself—for
example, by calling presentViewController:animated:completion:. You
should make sure that your apps are not using these methods to manage
the layout of any subviews. Instead, they should use the view
controller’s viewWillLayoutSubviews method and adjust the layout using
the view’s bounds rectangle.
Now I just need to figure out how to use the willLayoutSubviews method to replicate my original functionality.

Resources