MonoGame + iOS 8?

Has anyone had a chance to test a MonoGame app against the iOS 8 Beta yet? I haven’t had a chance to upgrade my Hackintosh to OS X Mavericks yet (which is the minimum requirement for iOS 8 development), so I haven’t had a chance to test it myself yet.

I’m keeping my fingers crossed that there won’t be any major bugs that cause our MonoGame apps to crash in iOS 8. Would love to hear from anyone who’s had a chance to try it out and hear about your experiences.

So I finally installed OS X Mavericks and tested MonoGame with iOS 8. The results were not great. It looks like a bunch of code related to iOSGameView is obsolete and broken in iOS 8. My game is no longer displays correctly—it’s being pushed down and cropped on the right.

Help! Any ideas @Tom, @daveleaver, @Nezz, others?

iOS 7

iOS 8

Someone will have to submit the fixes.

The question is do we need to maintain iOS7 support? For how long?

Also I am assuming if you run an iOS7 app on an iOS8 device it still works correctly… right?

I haven’t installed the iOS 8 Beta on actual hardware yet (so far I’ve just tested on the iOS Simulator), but I could try real hardware next. I know in the past when graphics issues like this arose with ExEn (an old XNA port I used to use), often the issue would be present on the new OS even if the app was built for the previous OS. So I wouldn’t be surprised if it doesn’t work correctly on an iOS 8 device. But who knows, I’ll try to test that.

As for iOS 7 support, I think it would be pretty aggressive to abandon it and only support iOS 8 at this point. I’ve been testing MonoGame on iOS 5, 6, and 7, and it works great on all of those platforms. It would be a shame to force a minimum of iOS 8 just because Apple annoyingly decided to change something again. So my vote would be to keep supporting iOS 5+ and try to find a workaround for this (hopefully minor) issue.

I’ll try to look into it too, but I’m assuming that you MonoGame experts might have an easier time solving this.

FYI, I think I figured this out.

First of all, I was wrong about the obsolete code in iOSGameView; those obsolete warnings are actually just part of MonoGame to encourage us to fix some imperfect code—they have nothing to do with anything Apple changed in the iOS 8 SDK.

The crux of the problem appears to be a change in the way that iOS 8 handles landscape orientation and reporting resolution. It used to always be that MonoGame had to flip width/height in landscape to get the correct window size, i.e.:

// Pseudo-code
if (InterfaceOrientation == Landscape)
    frame = new RectangleF(0, 0, Height, Width);
    frame = new RectangleF(0, 0, Width, Height);

iOS 8 finally seems to be reporting width and height correctly (shocking!), so flipping the two values for Landscape results in an incorrect window size.

I’ll do some more testing and work on submitting a PR fix later this week. Just wanted to post an update here so others don’t waste their time trying to solve this.