In the last Worldwide Developers Conference (WWDC 15), Apple has introduced a lot of amazing things, like Apple Music and brand new operating systems, as well as new APIs on all platforms. For Apple Watch, the watch OS 2 has been introduced to give WatchKit more features and capabilities. For iPhones and iPads, iOS 9 will be available with more new features like gaming technologies and multitasking for iPad and Search capabilities. For OS X, the new OS El Capitan will bring Metal for OS X. In this article, we are going to talk about the new features and APIs for iOS 9 and how to prepare your app for this next release.
I think many of you, like me, were dreaming to find the multitasking feature in iPad so you can run and work in more than one app at same time. In iOS 9, the dream has become a reality and you can get more things done in a similar timeframe with the new feature of multitasking. In iOS 9 you can run two iPad apps at the same time and both will be in a foreground state. There are three types of multitasking technologies in iOS 9:
In SlideOver multitasking, you can interact with a secondary app without leaving the current app. By swiping left from the right edge of your iPad, you can pick the secondary to be overlayed over your primary app (In RTL language, the secondary app appears on the left side by swiping from the left edge).
Thanks to Size classes in the interface builder, you see how the Calendar app has adapted itself to the new width size.This is the trick while working with Multitasking - to configure your app properly to work in all size classes mode.
After you have select your secondary app to be overlayed over your primary app in SlideOver mode, you will see a button at the center outside the SlideOver area:
When you tap on this button, you tell the system to enter the SplitView mode. In SplitView mode, the two apps will be displayed and adapted to the new width and the user can interact with two apps at the same time.
As you see, a divider will be added between the two apps and user can drag this divider to resize the two apps:
Users can drag the divider all the way to left to dismiss the secondary app. The same user can drag the divider all the way to right and in that case, the primary app will go to background and the secondary app will be the primary app.
In picture-in-picture mode (it's called also PiP), you can add a floating window of a playing video while the two apps are in the foreground. This video comes from a third app and this app is in the background.
Not all iPad models support the features of multitasking in iOS 9, check the table below to check the models:
Now you almost know everything about multitasking but from user perspective. Here we will talk from the developer perspective and discuss challenges you would face while adopting multitasking. The biggest challenges in supporting multitasking are resource management and adapting properly to the different size classes.
While working in multitasking, your app memory pressure will be increased and time-per-frame will be affected, so try to use memory and resources wisely. Using much more time-per-frame may cause your screen updates to be under 60 fps and, in that case, the system will terminate the app with most memory usage.
If you are using Xcode 7, any new template-based project will be ready for Slide Over and Split View. If you want to adopt an old project to be ready for iOS 9, your Xcode project should be configured as follows:
1. Set the Base SDK to the latest iOS version
2. Support all interface orientations in iPad
3. Provide a LaunchScreen.storyboard file instead of using png images
Now your app is configured for Split View and Slide Over. In either mode, the primary and secondary apps are both in a foreground state but the primary app has only some features:
In Split View only, the sizes of two apps can be changed when the user drags the divider left and right or by rotating the device (changing interface orientation). In that case the system will invoke the apps for this change in bounds of apps windows, so the view controllers size classes will be changed. In Slide Over, the size of two apps can't be changed as there is no divider or event where the apps will be rotated in interface orientation change.
We know that in normal iPad apps, the horizontal and vertical size classes are always regular. But now with the different scenarios of Split View mode, we have different cases for horizontal size classes. Check the following image:
To make your app adaptive to all this changes, you have to employ Autolayout and Size classes properly.
In Split View mode, the two apps enter offscreen whenever the user moves the divider. Check the following screenshot while moving the divider of two apps in Split View:
And in this time, the system will call the app delegate applicationWillResignActive: method to let your app know that it will move from an active to an inactive state. And in a tricky way, the system will resize your app (while it's in offscreen) to capture snapshots to provide a smooth user experience when a user eventually releases the divider.
While resizing and snapshotting, your app should not lose anything from what is was before the user touches the divider. Any data loss, changing navigation state, scrolling position, selection state, or anything similar should not happen. Everything should be in the same state when the user starts to resize and move the divider.
Apps that decided to opt out of using multitasking and work in fullscreen mode will be affected with multitasking features and they don't have exclusive use of resources like memory, CPU, and screen. While your app is in fullscreen mode, these scenarios c
As you see in the previous screenshot,the Settings app in iOS is working in fullscreen mode and is opting out of using multitasking features. However, we could display the Calendar app in Slide Over mode and use the Keyboard. The button of entering Split View mode is not appeared as Settings app is in fullscreen mode.
So as you see, opting out of using multitasking is actually only being opted to appear in Slide Over apps area or entering Split View mode. In other words, you can't ever be a secondary app but you still can host a secondary app in Slide Over mode and PiP.
Apple and your customers expect your app to adopt to Split View and Slide Over. Your opting out will be considered only if your app fall in one of these categories:
Opting out In Xcode:
To configure your Xcode project to opt out of appearing in Slide Over or in Split View mode, add the key UIRequiresFullScreen in Info.plist file and set it's value to YES.
Note: User can disable Slide Over and Split View for any app from Settings => General => Multitasking
PiP is available for apps where it's primary role or feature is to playback videos. Here is some notes to consider before supporting PiP:
To make your app eligible for PiP, do the following configuration in Xcode 7 project:
Now use AVKit, AVFoundation or WebKit. You choice depends on your app and user experience:
For any given video in your app, you can easily opt out of using PiP by doing one of the following:
Prototype is an iOS app development company based in Dubai and Miami. Contact us for a free consulation.
Subscribe to our blog to receive relevant news and tips about digital transformation, app development, website development, UX, and UI design. Promise we won't spam you.