Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
© 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
What’s New in StoryboardsMapping the flow of your app
Kyle Sluder UIKit FrameworksTony Ricciardi Development Technologies
App Frameworks #WWDC15
Session 215
What’s New
Organizing Your StoryboardsCustomizing Standard SeguesUnwind Segues and Custom Containers
Organizing Your Storyboards
Main Storyboard
NavigationController
Collection ViewController
Photo ViewController
Main Storyboard
NavigationController
Collection ViewController
Photo ViewController
contains shows
Main Storyboard
NavigationController
Collection ViewController
Photo ViewController
root shows
Main Storyboard
NavigationController
Collection ViewController
Photo ViewController
root shows
Scenes
Interface Builder Core Concepts WWDC 2013
Main Storyboard
NavigationController
Collection ViewController
Photo ViewController
showsroot
Segues
Interface Builder Core Concepts WWDC 2013
Main Storyboard
NavigationController
Collection ViewController
Photo ViewController
showsroot
Relationship Segue
Interface Builder Core Concepts WWDC 2013
Main Storyboard
NavigationController
Collection ViewController
Photo ViewController
showsroot
Triggered Segue
Interface Builder Core Concepts WWDC 2013
Main Storyboard
NavigationController
Collection ViewController
Photo ViewController
root shows
Main.storyboard
photoController
showPic
collectionVC
Main.storyboard
photoController
showPic
collectionVC
Main.storyboard
photoController
showPic
collectionVC
Main.storyboard
photoController
showPic
collectionVC
Main.storyboard
photoController
showPic
collectionVC
Main.storyboard
photoController
showPic
collectionVC
Main.storyboard
photoController
showPic
collectionVC
Main.storyboard
photoController
showPic
collectionVC
Main.storyboard
photoController
showPic
collectionVC
Main.storyboard
photoController
showPic
collectionVC
Main.storyboard
photoController
showPic
collectionVC
UIStoryboard(name: "Secondary")
UIStoryboard(name: "Secondary") .instantiateViewControllerWithIdentifier("tabController")
Storyboard References
Stands in for another sceneCan be destination of Relationship or Triggered SegueReference can be in same storyboard or another storyboard
Secondary Storyboard
Main Storyboard
DemoUsing storyboard references
Customizing Standard Segues
Table ViewController
Table ViewController
Table ViewController
presentmodally
Table ViewController
NavigationController
presentmodally
Table ViewController
Table ViewController
Table ViewController
presentmodally
Table ViewController
presentmodally
NavigationController
Table ViewController
Table ViewController
NavigationController
Table ViewController
NavigationController
Table ViewController
NavigationController
Table ViewController
NavigationController
Table ViewController
NavigationController
Table ViewController
NavigationController
Table ViewController
NavigationController
Table ViewController
NavigationController
{}
class MySegue: UIStoryboardSegue {
override func perform() -> () {
setUpAnimation()
sourceViewController .presentViewController(...) } }
Segue Subclassing
Can specify a UIStoryboardSegue subclass for any triggered or unwind segueOverride perform()Call super.perform() for standard behaviorPresent Modally and Popover Presentation segues retained throughout presentation
Segue SubclassingCustomizing presentation animations
Segue Subclassing
User triggers segue
Customizing presentation animations
Segue DestinationView Controller
Segue Subclassing
User triggers segue• Assign transitioning delegate
Customizing presentation animations
TransitioningDelegate
Segue DestinationView Controller
Segue Subclassing
User triggers segue• Assign transitioning delegate• Call super.perform() to
start modal presentation
Customizing presentation animations
TransitioningDelegate
Segue DestinationView Controller
Segue Subclassing
User triggers segue• Assign transitioning delegate• Call super.perform() to
start modal presentation• Vend animation controller
for presentation
AnimationController
Customizing presentation animations
TransitioningDelegate
Segue DestinationView Controller
Segue Subclassing
User triggers segue• Assign transitioning delegate• Call super.perform() to
start modal presentation• Vend animation controller
for presentation• Animate appearance of
view controller
AnimationController
Customizing presentation animations
TransitioningDelegate
Segue DestinationView Controller
DestinationView Controller
Custom Transitions Using View Controllers WWDC 2013
Segue SubclassingCustomizing presentation animations
TransitioningDelegate
Segue DestinationView Controller
Custom Transitions Using View Controllers WWDC 2013
Segue Subclassing
User dismisses presentation
Customizing presentation animations
TransitioningDelegate
Segue DestinationView Controller
Custom Transitions Using View Controllers WWDC 2013
AnimationController
Segue Subclassing
User dismisses presentation• Vend animation controller
for dismissal
Customizing presentation animations
TransitioningDelegate
Segue DestinationView Controller
Custom Transitions Using View Controllers WWDC 2013
Segue Subclassing
User dismisses presentation• Vend animation controller
for dismissal• Animate dismissal of
view controller
Customizing presentation animations
Segue
Custom Transitions Using View Controllers WWDC 2013
Getting Started with Multitasking on iPad in iOS 9 Presidio Tuesday 4:30PM
Segue SubclassingCustomizing adaptive presentations
Segue DestinationView Controller
PresentationController
Segue SubclassingCustomizing adaptive presentations
User triggers segue Segue DestinationView Controller
PresentationController
Segue SubclassingCustomizing adaptive presentations
User triggers segue• Assign delegate to presentation controller
Segue
AdaptiveDelegate
DestinationView Controller
PresentationController
Segue SubclassingCustomizing adaptive presentations
User triggers segue• Assign delegate to presentation controller• Call super.perform() to perform
modal presentation
Segue
AdaptiveDelegate
DestinationView Controller
PresentationController
DestinationView Controller
Segue SubclassingCustomizing adaptive presentations
User triggers segue• Assign delegate to presentation controller• Call super.perform() to perform
modal presentation
Size class changes
Segue
AdaptiveDelegate
DestinationView Controller
PresentationController
DestinationView Controller
Segue SubclassingCustomizing adaptive presentations
User triggers segue• Assign delegate to presentation controller• Call super.perform() to perform
modal presentation
Size class changes• Presentation controller informs delegate
Segue
AdaptiveDelegate
DestinationView Controller
PresentationController
DestinationView Controller
Segue SubclassingCustomizing adaptive presentations
User triggers segue• Assign delegate to presentation controller• Call super.perform() to perform
modal presentation
Size class changes• Presentation controller informs delegate• Delegate vends new view controller
Segue
AdaptiveDelegate
DestinationView Controller
PresentationController
DestinationView Controller
AdaptiveView Controller
View Controller Advancements in iOS 8 WWDC 2013
DemoCustomizing standard segues
Unwind Segues and Custom Containers
“Take me home”
“Take me home”
“Take me home”1. Identify destination
“Take me home”
2. Find destination
1. Identify destination
“Take me home”
2. Find destination
3. Follow route
1. Identify destination
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Unwind Segues
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
“Go back to the journal”
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
performSelectorWithIdentifier("goBackToJournal", sender:…)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind SeguesIdentify the destination
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind SeguesIdentify the destination
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind SeguesIdentify the destination
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind SeguesIdentify the destination
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
@IBAction func iAmTheJournal(_: UIStoryboardSegue) -> () { // empty }
Unwind SeguesIdentify the destination
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind SeguesFind the destination
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind SeguesFind the destination
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
viewControllerForUnwindSegueAction("iAmTheJournal:", withSender:…)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
override allowedChildViewControllersForUnwindingFromSource(_:)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
childViewControllerContainingSegueSource(_:)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
childViewControllerContainingSegueSource(_:)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
childViewControllerContainingSegueSource(_:)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
override allowedChildViewControllersForUnwindingFromSource(_:)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
canPerformUnwindSegueAction("iAmTheJournal:", fromViewController:…)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
canPerformUnwindSegueAction("iAmTheJournal:", fromViewController:…)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
override allowedChildViewControllersForUnwindingFromSource(_:)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
childViewControllerContainingSegueSource(_:)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
childViewControllerContainingSegueSource(_:)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
override allowedChildViewControllersForUnwindingFromSource(_:)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
override allowedChildViewControllersForUnwindingFromSource(_:)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
canPerformUnwindSegueAction("iAmTheJournal:", fromViewController:…)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
canPerformUnwindSegueAction("iAmTheJournal:", fromViewController:…)
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Unwind Segues
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
override segueForUnwindingToViewController(_:fromViewController:identifier:)
Incremental Unwinding
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Incremental Unwinding
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Segue
Incremental Unwinding
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Segue
perform()
Incremental Unwinding
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Segue
Incremental UnwindingFollow the route
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Segue
Incremental UnwindingFollow the route
Custom TabView Controller
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Segue
Incremental Unwinding
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
SegueCustom Tab
View Controller
Incremental Unwinding
Journal Navigation Controller
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
override unwindForSegue(segue, towardsViewController:custom tab)
SegueCustom Tab
View Controller
Incremental Unwinding
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
Segue
Journal Navigation Controller
Custom TabView Controller
Incremental Unwinding
Journal TableView Controller
Photo Navigation Controller
Photos CollectionView Controller
PhotoView Controller
override unwindForSegue(segue, towardsViewController:journal nav)
Segue
Journal Navigation Controller
Custom TabView Controller
Incremental Unwindingoverride unwindForSegue(segue, towardsViewController:journal nav)
Segue
Journal TableView Controller
Photo Navigation Controller
PhotoView Controller
Photos CollectionView Controller
Journal Navigation Controller
Custom TabView Controller
Incremental Unwindingoverride unwindForSegue(segue, towardsViewController:journal nav)
SegueCustom Tab
View Controller
Journal TableView Controller
Journal Navigation Controller
Incremental Unwinding
Custom TabView Controller
Journal TableView Controller
Journal Navigation Controller
Segue
Incremental Unwinding
Custom TabView Controller
override unwindTowardsViewController(CustomTab, fromViewController:Photo)
Journal TableView Controller
Journal Navigation Controller
Segue
Incremental Unwinding
Custom TabView Controller
Journal TableView Controller
Journal Navigation Controller
DemoUnwind segues and custom containers
Unwinding APIsFinding the destination
viewControllerForUnwindSegueAction(_:fromViewController:sender:)
override allowedChildViewControllersForUnwindingFromSource(_:)
childViewControllerContainingSegueSource(_:)
override canPerformUnwindSegueAction(_:fromViewController:sender:)
Unwinding APIsFollowing the route
segueForUnwindingToViewController(_:fromViewController:identifier:)
override unwindForSegue(_:towardsViewController:)
Summary
Summary
Organize your storyboards using Storyboard References
Summary
Organize your storyboards using Storyboard ReferencesCustomize triggered and unwind segues by subclassing
Summary
Organize your storyboards using Storyboard ReferencesCustomize triggered and unwind segues by subclassing• Present Modally and Popover Presentation segues have extended lifetimes
Summary
Organize your storyboards using Storyboard ReferencesCustomize triggered and unwind segues by subclassing• Present Modally and Popover Presentation segues have extended lifetimes
Unwind segues move backward through application flow
Summary
Organize your storyboards using Storyboard ReferencesCustomize triggered and unwind segues by subclassing• Present Modally and Popover Presentation segues have extended lifetimes
Unwind segues move backward through application flow• Support unwind segues in custom containers
Summary
Organize your storyboards using Storyboard ReferencesCustomize triggered and unwind segues by subclassing• Present Modally and Popover Presentation segues have extended lifetimes
Unwind segues move backward through application flow• Support unwind segues in custom containers• Remove implementations of deprecated API to get new behavior
More Information
DocumentationStoryboard Help
Sample CodeSegueCatalog
http://developer.apple.com/library
Technical SupportApple Developer ForumsDeveloper Technical Support
General InquiriesCurt Rothert, App Frameworks [email protected]
Related Session and Lab
Implementing UI Designs in Interface Builder Pacific Heights Wednesday 1:30PM
Interface Builder and Auto Layout Lab Developer Tools Lab B Thursday 1:30PM