willem.com

Multi-Window support in your iPad app

Native development for iPadOS

Oct. 7, 2019 -

Last month Apple released iPadOS, the first dedicated operating system for iPad. It differs from iOS with its support for the larger iPad screen, including multi / split screen windows. I develop apps and it was time to take advantage of these new possibilities that iPadOS offers.

Ever since 2016 I have been using iPad as my main computer, it's a great mobile computer. The operating system is however, unlike that of most computers. iPadOS is based on iOS that runs on Apple's popular mobile phone, the iPhone. This makes the iPad a little different in daily use because of how it run apps.

iPad Pro as my main computer connected to a terminal using Blink
iPad Pro as my main computer connected to a terminal using Blink

Because of the smartphone roots of iPadOS, the operating system handles apps like an iPhone does: apps run full screen focused on a single task. People love iPad for this as it's a great way to keep your mind concentrated on a single thing.

Multiple Windows support for iPad

There are situations where running multiple windows simultaneously can be very useful, and this is where Apple improved iPadOS when it introduced support to run apps side-by-side.

Multiple window support on iPad, running two instances of the same app at once
Multiple window support on iPad, running two instances of the same app at once

Even if you're working on a single task, having support for multiple windows is very useful as it allows you to run multiple instances of the same app at once. This enables different use-cases where you can look and edit content from different angles. Like comparing two different months in your agenda, editing a long document or looking at the map at different scales simultaneously.

Comparing different months in the calendar app
Comparing different months in the calendar app
Looking at the map at different scales simultaneously
Looking at the map at different scales simultaneously

Design Intent

When Apple introduced the support for multiple windows on iPad they designed this with respect to the mobile roots of iPadOS. Unlike traditional PC apps, where complex software can run through multiple different windows (and panels) by default, iPadOS maintains the requirement that an app must be able to do everything from a single window.

It's a design requirement on iPad that all app windows are of the same kind, and each one can do everything in the application. The user could do anything from one window if they want to. They should be able to create multiple windows only if they think it's useful, but the app should never require that. This facilitates the simple way apps run oniPadOS, you can continue to use apps full screen like on a smartphone.

Ken Ferry explaining the design of multiple window support for iOS during WWDC 2019
Ken Ferry explaining the design of multiple window support for iOS during WWDC 2019

App Lifecycle (and code changes)

From a technical perspective Apple introduced UIWindowScene with a corresponding UISceneSession abstraction in the UI structure. It sits between the UIScreen and UIWindow.

Conceptual overview UI structure iPadOS as explained by Steve Holt during WWDC 2019
Conceptual overview UI structure iPadOS as explained by Steve Holt during WWDC 2019
Conceptual overview of UISceneSession, providing the persistent interface state between app representations (WWDC 2019, Steve Holt, Apple)
Conceptual overview of UISceneSession, providing the persistent interface state between app representations (WWDC 2019, Steve Holt, Apple)

When iPadOS (and iOS) run multiple apps, it is possible that the operating systems closes an app from the background to safe memory and power. This is by design: it keeps the operating system fast and kind to the battery.

From an app lifecycle perspective, this means that you need to check if your app was running before when it is started. When there is an existing UISceneSession the app should reconnect to it, to provide a persistent interface state to the user. When done right, the user will not notice that the app was interrupted while in the background.

Functional roles in the lifecycle of an iPadOS app (WWDC 2019, Steve Holt, Apple)
Functional roles in the lifecycle of an iPadOS app (WWDC 2019, Steve Holt, Apple)

If you adopt the new UIWindowScene (and UISceneSession) concepts in your app, you'll be able to take advantage of the new multi-window capabilities of iPad. But there is one more thing: Apple is planning to bring iOS and iPadOS apps to the Mac. With the new UI concepts your app will run great on macOS, too!

The same app on iOS/iPadOS and macOS
The same app on iOS/iPadOS and macOS

In practice

As developer I had little trouble implementing the new UI concepts in my apps. With relatively little effort you can enable many different use cases where the same app provides more power to the user.

Using my
Using my "Lemmid (content) Manager" app to edit a blog post while looking at the results side-by-side
Editing a DNS record using my
Editing a DNS record using my "Lemmid Domain" app while preserving context of the entire DNS zone
Using my
Using my "Lemmid Count" app to analyse views and traffic an article on willem.com
Web development on iPad using Inspect and Blink side-by-side
Web development on iPad using Inspect and Blink side-by-side

Conclusion

Apple did not rush the support for multiple windows on iPad, but took its time to design it well. If you adopt the new concepts your app will be more powerful to the users.

It's always a good idea to take your time to understand underlying interface concepts before you start developing. Do it right (and good) instead of fast (and stupid)!

Did you enjoy this post?

If you found this content useful,
consider showing your appreciation
by buying me a coffee ❤️😋:

Reach out to me on :

@wlmiddelkoop

Latest Stories

all AppleDesigniOSiPadProgrammingTabletWork

Articles (153)