herzbube / littlego

Little Go. An iOS application that lets you play the game of Go on the iPhone or iPad.
https://littlego.herzbube.ch/
Apache License 2.0
138 stars 53 forks source link

Support multitasking on iPad #304

Open herzbube opened 8 years ago

herzbube commented 8 years ago

With iOS 9, it is not possible on iPad devices to have three types of multitasking, nicely outlined in the Adopting Multitasking Enhancements on iPad guide in Apple's iOS documentation (the following text is quoted from that guide):

With the release of Little Go that is currently in the App Store, the user cannot select the app for "Slide Over" and "Split View" scenarios (I haven't tested "Picture in Picture"), probably because the released app was not built with the iOS 9 SDK. I have verified this on an iPad Pro. Building the app with the iOS 9.3 SDK (#298) however makes the app eligible for these multitasking scenarios, so the app must properly support these scenarios.

herzbube commented 8 years ago

If the user is floating a PiP window over the Little Go, there's nothing that we can do about it. Also, Little Go is not itself a PiP app. So in the end we don't have to do anything special to support PiP.

The other two scenarios are a different matter, because they result in the app getting a lot less space on the screen than the code currently anticipates. Two quick and simple tests reveal that there is indeed a problem in this regard.

Test 1:

Test 2:

herzbube commented 8 years ago

The changes that iPad multitasking introduces and that Little Go must adapt to are best expressed by the following quotes from the "Getting Oriented" section of the "Adopting Multitasking Enhancements on iPad" guide (see the initial issue text for the URL):

In iOS 9, it’s no longer appropriate to think in terms of device idiom or interface orientation. Your app can find itself in either a compact or regular horizontal size class on iPad, with size changes independent of interface orientation. Instead, employ trait collections and size classes (see UITraitCollection Class Reference), and adopt the UIContentContainer and UITraitEnvironment protocols, as described in Slide Over and Split View Quick Start.

and

Likewise, in iOS 9 it’s no longer appropriate to employ the screen’s bounds to gauge your app’s visible area. Instead, obtain the value of your app’s window’s bounds property (which the UIWindow class inherits from the UIView class.)

herzbube commented 8 years ago

The app must provide layouts for the following scenarios:

Cf. section "Slide Over and Split View Quick Start" in the "Adopting Multitasking Enhancements on iPad" guide.

herzbube commented 8 years ago

Analysis: Where do we use UIScreen bounds?