Getting started with Multitasking in iPad (205)
Sliding map on top of Safari
Can promote from Slide over to split view by dragging/tapping slider, can be resized interactively by user and doesn’t trigger size class update
mini player for video
iPhone (portrait/landscape) -> Compact iPhone 6+ (portrait) -> Compact iPhone 6+ (landscape) -> Regular iPad (portrait) -> Regular iPad (landscape) -> Slide over: Compact Full screen: Regular
Need to adopt it in order to show up in the app picker
- Build against 9
- Support all orientations
- Use launch storyboard
- Opt out with UIRequiresFullscreen key in info.plist
UIScreen
-bounds
still returns screen bounds, and UIWindow
-bounds
now returns the bounds of your window (origin always {0, 0}
)
- You won’t always get size class changes for window resizes
- Use autolayout
- Position views with consideration to readableContentGuide, which will increase/decrease margins depending on the size in order to ensure legibility
UITableView
cellLayoutMarginsFollowReadableWidth
adds margins to cell to accomplish the same
Remove explicit handling for orientations, instead represent different orientation layouts as size change and rotation
Same between rotation and multitasking resizing
willTransitionToTraitCollection
/viewWillTransitionToSize
- Setup
willTransitionToTraitCollection
viewWillTransitionToSize
traitCollectionDidChange
time limit with watchdog - Create animations
animateAlongsideTransition
- Run animations
- Cleanup
completion
block ofanimateAlongsideTransition
If theres no change in trait collectionviewWillTransitionToSize
->animateAlongsideTransition
If theres no change in sizeviewWillTransitionToTraitCollection
,traitCollectionDidChange
->animateAlongsideTransition
Custom created UIWindows that are not the same size as your keyWindow will be translated but not scaled as window size changes. Use default init to get correct “full screen” behavior: UIWindow()
UIAdaptivePresentationControllerDelegate
adaptivePresentationStyleForPresentationController
willChangePresentationStyle
Hooks to change the app UI in response to a change in the presentation style (can now go from regular to compact)
Respond to notifications from the UIKeyboard…Notification, to ensure that the important UI is visible even when another app is the one that caused the keyboard to be presented
- Make app universal
- Design for size classes rather than devices
- Be flexible, don’t hardcode sizes
- Maintain same appearance when deactivated
- Save size / state on deactivation and onSizeChange don’t change unless active or is the persisted size
- Do as little as possible