Orientation in iOS8


#1

Seems there is a problem with iOS8. The JuceDemo app orientation does not work correctly on iPad with iOS8.0.

Same applies to my own apps using Juce...(worked on iOS7)

Could be linked to this: https://github.com/TransitApp/SVProgressHUD/pull/284


#2

http://forum.openframeworks.cc/t/ios-8-of-not-setting-orientation-properly/16729


#3

To clarify, there's basically two orientation problems to deal with here that I see: 1) when the UI first opens, it is not correctly orienting itself (if I open in landscape, it is in portrait) and 2) when the device is physically rotated, the orientation does not update correctly.

have been reading up on this a bit. I think what needs to happen is this: when rotating the device, a Juce app doesn't need to rotate itself, but it does need to change its bounds. Apple have decided to simplify how device rotation is done, so in practice developers shouldn't have to think about rotating their UI, just what its new bounds will be when it's rotated.

All of the old rotation stuff (willRotateToInterfaceOrientation:, etc) is deprecated and the replacement is:

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator;

(EDIT: i had posted a partial workaround, but i realized it wasn't doing what I thought it was! I'll keep trying!)


#4

I really have not been able to figure this one out. 

Commenting out line 247 in juce_ios_UIViewComponentPeer.mm (window.transform = Orientations::getCGTransformFor (desktop.getCurrentOrientation()); ) results in correct rotation but a cropped UI in landscape modes. Also, pop up windows are still not rotating correctly. 

That's as far as I have been able to get in 1 day! Someone who understands Juce/iOS windowing subtleties is going to have to take a look at this.


#5

I think only Jules can sort this out...

;)

 


#6

Yeah this is really annoying. I stupidly did not keep my previous version of XCode and now I can't send my app for testing. My app works in landscape mode only and is unusable right now.

Jules any priority on this ? If you are too busy on other things I understand and then I will re-install XCode 5 but frankly I'd hate to do that...


#7

Am very busy, but since Xcode 6 now seems to getting rolled-out as an automatic update then I guess I'll need to work on it soon.


#8

Thank you so much. I hate to pressure you like this but I REALLY appreciate your concern on this matter.


#9

Happy to read this!

I'm facing the same problem.

Thanks!

 


#10

See this:

http://www.juce.com/comment/307578#comment-307578

It does seem to be something to do with the project's settings - I'll see if I can make the introjucer produce whatever new settings are needed, but in the meantime you can probably just do what was suggested on the other thread to get it going.


#11

I've always manually used the asset catalog - I have found that simply naming the files what they are supposed to be doesn't work (in all cases, for some images it would). So I created the asset catalog, and even though the introjucer clobbers it each time, I was still able to drag it back  into the project it and then use it for my app.

 

However, as the other thread suggests, this is not working for me...app is still oriented incorrectly and mis-scaled.


#12

Yeah same problem even when using Image assets.

:(


#13

So does anyone have a workaround for this ? The app is unusable on iOS...


#14

I began working on this, but it's proving harder than expected, and I have a lot of distractions this week. Firstly I'm going to modify the introjucer to generate these asset files, and then try to figure out what the hell is going on with the rotation. Am on the case, but any clues people can find will help!


#15

​I don't know if that helps but...

Developers at OpenFrameWorks seemed to have the same problem (https://github.com/openframeworks/openFrameworks/issues/3158) and to have fixed it (https://github.com/openframeworks/openFrameworks/pull/3165).


#16

There is also this which I referenced in a previous post:

https://github.com/TransitApp/SVProgressHUD/issues/282


#17

Apple's approach to orientation and their various attempts to fix it over the last few years have provided some amusement.  My desk still retains some of the marks impressed upon it by my forehead during these amusement periods.

I'm not using the parts of Juce which handle windowing etc. and this may be unrelated to its current issues, but just in case I can help put you on the right path:

In iOS 8, [[UIScreen mainScreen] bounds] now returns the display bounds at the CURRENT orientation, NOT the device/portrait relative bounds (independent to orientation) as it used to.

The equivalent functionality (if still needed) is provided by [UIScreen mainScreen].fixedCoordinateSpace.bounds

I'm sure rule #1 in the API rulebook says you shouldn't repurpose existing APIs like this!


#18

I've committed a sort-of fix for this... It seems to work for me now except for upside-down, which doesn't trigger any callbacks to let the view know that the orientation changed. I have to move on to some other things now, but if anyone has anything to add about this, please let me know!


#19

It works ! Thank you !!!!

I don't know what you mean by upside-down problem, though. When I flip around (180°) my iPad, the screen gets turned around as it should.


#20

That's good to hear! Maybe a simulator thing, but for me it doesn't seem to register when it becomes upside-down.