iOS 9 and split screen mode

Apple recently announced split screen mode in iOS 9.

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

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!

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