- Home /
iOS 9 and split screen mode
Apple recently announced split screen mode in iOS 9.
http://techcrunch.com/2015/06/08/apple-ipad-gets-split-screen-multitasking-in-ios-9/#.xmwp7y:FctY
From the article:
The best news, Federighi notes: “If you’ve adopted auto layout, this will all just work,” he says.
My question is, do Unity apps use auto layout? Can I expect my Unity iOS apps to "just work" with this new split screen mode? Has anyone tested the developer version of iOS 9 with Unity to see if this works?
Thanks! Jared
Answer by Beamy · Aug 03, 2015 at 07:38 PM
Yes I was able to get split screen multitasking to work with my Unity app. I'm using an iPad Air 2 and Unity 5.0.3p3. You have to make sure that the following is true:
You are using an iPad Air 2 or newer
You're on iOS 9 (I'm on beta 4)
You have enabled all allowed orientations and autorotate (Portrait, Portrait Upside Down, Landscape Left, Landscape Right)
In the XCode project Info.plist file, you must have the "UILaunchStoryboardName" key pointing to the launch screen, default is "LaunchScreen"
The orientations can be simply set in Build Settings -> Player Settings -> iOS -> Resolution and Presentation
As for the the XCode project Info.plist file, you can automate it in the Post Build (http://docs.unity3d.com/412/Documentation/ScriptReference/PostProcessBuildAttribute.html).
Like so:
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Linq;
public static class BuildPostProcessor {
[PostProcessBuild(100)]
public static void OnPostProcessBuild(BuildTarget target, string path)
{
// Unity renamed build target from iPhone to iOS in Unity 5, this keeps both versions happy
if (target.ToString() == "iOS" || target.ToString() == "iPhone")
{
const string fileName = "Info.plist";
string filePath = Path.Combine(path, fileName);
string launchScreenName = "LaunchScreen";
XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
XmlReader plistReader = XmlReader.Create(filePath, settings);
XDocument doc = XDocument.Load(plistReader);
XElement plist = doc.Element("plist");
XElement dict = plist.Element("dict");
PListDictionary xmlDict = new PListDictionary(dict);
plistReader.Close();
// Add relevant keys
xmlDict["UILaunchStoryboardName"] = launchScreenName;
// Corrected header of the plist
string publicId = "-//Apple//DTD PLIST 1.0//EN";
string stringId = "http://www.apple.com/DTDs/PropertyList-1.0.dtd";
string internalSubset = null;
XDeclaration declaration = new XDeclaration("1.0", "UTF-8", null);
XDocumentType docType = new XDocumentType("plist", publicId, stringId, internalSubset);
// Save
xmlDict.Save(filePath, declaration, docType);
}
}
}
Hope this helps!
Answer by manny003 · Jun 09, 2015 at 02:06 PM
I just installed iOS9 on my iPad mini 1st Gen. Split screen is not supported on this device but I tried to run my game already on the App Store created with Unity 4.0 as well as the new final beta version of that same game created in Unity 5.0.2p4 (IL2CCP) -- both crashes soon after start-up.
Then again, this is only the first Beta of iOS 9 and still very early in the shake out process so I would not be surprised that there are crashes.
Manny
Just FYI - ensure your app supports 64-bit for iOS. iOS 9 seems to crash 32-bit only apps, as I discovered with my company's application this morning.
As of June 1st, any app updates submitted to Apple $$anonymous$$UST support 64-bit, as well.
Right. I compiled using IL2CCP for 64bit support and it also crashed.
I installed iOS 9 on an iPad Air 2, and our IL2CPP build worked great. The one that did not build with IL2CPP support crashed.
You know what really blows my $$anonymous$$d?
I just downloaded the newest version of HearthStone which supports 64 & 32 bit onto my iPad $$anonymous$$i(1st Gen) running the new iOS 9 Beta -- and played a match just fine (I lost). No crashes or obvious problems. Runs at about the same speeds as it did when I had iOS 7 on this same device.
As I understand it, HearthStone was made with Unity. And it's not a simple game either, by any stretch of the imagination.
How do those guys do it? They're freaks, I tell ya.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Lock keyboard layout iOs 1 Answer
fontSizeUsedForBestFit not working as expected on iOS? 0 Answers
Get the height of ios keyboard according to the unity units 1 Answer
Overriding Screen Orientation settings at runtime (iOS) 1 Answer