Академический Документы
Профессиональный Документы
Культура Документы
© 2019 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
App A App B
App C App D
App A App A
App A App A
•
Design intent
•
Next steps
•
Design intent
•
Next steps
Where should I add scenes to my app?
NEW
NEW
Mac
What interactions should create scenes?
X
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum."
Design intent
•
Next steps
•
Design intent
•
Next steps
•
Steve Holt
Conceptual Overview
UIWindowScene
UISceneSession
Conceptual Overview
UI structure
UIScreen
Conceptual Overview
UI structure
UIWindowScene UIWindowScene
UIScreen
Conceptual Overview
UIScene
UIWindowScene
UIScreen
Conceptual Overview
UISceneSession
UIScreen
Conceptual Overview
UISceneSession
UIScreen
Conceptual Overview
Application and scene lifecycle
Scene
Foreground
Active
Foreground
Inactive
App
Background
Scene
Foreground
Active
Foreground
Inactive
App
Background
Scene
App
Foreground
Active
Foreground
Inactive
Background
Scene
App
Foreground
Active
Foreground
Inactive
Background
Scene
Foreground
Active
Foreground
Inactive
App
Background
UIApplication UIApplicationDelegate
Conceptual Overview
Functional roles
Process Events
Process State
and Lifecycle
UIApplication UIApplicationDelegate
application(_:didFinishLaunchingWithOptions:)
applicationWillEnterForeground(_:)
applicationDidBecomeActive(_:)
applicationWillResignActive(_:)
applicationDidEnterBackground(_:)
…
application(_:open:options:)
…
application(_:continue:restorationHandler:)
Conceptual Overview
Migrating your code
scene(_:willConnectTo:options:)
sceneWillEnterForeground(_:)
sceneDidBecomeActive(_:)
sceneWillResignActive(_:)
sceneDidEnterBackground(_:)
…
scene(_:openURLContexts:)
…
scene(_:continue:)
Conceptual Overview
UIScene state restoration
Demo
•
Steve Holt
•
Design intent
•
Next steps
•
Design intent
•
Next steps
Conceptual Overview
Drag and drop
NSUserActivity based
Design intent
•
Next steps
•
Design intent
•
Next steps
•
James Savage
App A App A
App A App A
App A App A
Session Session
App A App A
Session Session
App A App A
Session Session
App A App A
Session Session
Manage Scene Sessions NEW
API on UIApplication
Close scenes
• requestSceneSessionDestruction(_:options:errorHandler:)
// Open a New Window NEW
}
// Open a New Window NEW
}
// Open a New Window NEW
}
// Update App Switcher Snapshot NEW
}
// Update App Switcher Snapshot NEW
}
// Close a Window NEW
switch action {
case .send: options.windowDismissalAnimation = .commit
case .save: options.windowDismissalAnimation = .decline
case .delete: options.windowDismissalAnimation = .standard
}
}
// Close a Window NEW
switch action {
case .send: options.windowDismissalAnimation = .commit
case .save: options.windowDismissalAnimation = .decline
case .delete: options.windowDismissalAnimation = .standard
}
}
// Close a Window NEW
switch action {
case .send: options.windowDismissalAnimation = .commit
case .save: options.windowDismissalAnimation = .decline
case .delete: options.windowDismissalAnimation = .standard
}
}
// State Restoration NEW
class UISceneSession {
}
// State Restoration NEW
class UISceneSession {
}
// State Restoration NEW
class UISceneSession {
}
// State Restoration NEW
class UISceneSession {
}
// State Restoration NEW
class UISceneSession {
}
// State Restoration NEW
class UISceneSession {
}
Debugging Tips
Debugging Tips
UserDefaults.standard
NotificationCenter.default UIScreen.main
FileManager.default
UIApplication.shared
MyFancySingleton.shared
AppData.shared
UIDevice.current
UserDefaults.standard
NotificationCenter.default UIScreen.main
FileManager.default
UIApplication.shared
MyFancySingleton.shared
AppData.shared
UIDevice.current
UserDefaults.standard
NotificationCenter.default UIScreen.main
FileManager.default
UIApplication.shared
globalVar
MyFancySingleton.shared
AppData.shared
UIDevice.current
UserDefaults.standard
NotificationCenter.default UIScreen.main
FileManager.default
UIApplication.shared
globalVar
UserDefaults.standard
NotificationCenter.default UIScreen.main
FileManager.default
UIApplication.shared
globalVar
"~/Library/MyApp/Draft"
Case Study
•
State restoration
Case Study
State restoration
protocol UIApplicationDelegate {
}
•
Case Study
•
UserDefaults
// Add a Key-Value Observable Property to UserDefaults
extension UserDefaults {
}
// Add a Key-Value Observable Property to UserDefaults
extension UserDefaults {
}
// Observe Changes in the View Controller
}
// Observe Changes in the View Controller
}
// Observe Changes in the View Controller
}
UIApplication Deprecations
• statusBarHidden
• statusBarOrientation
Opening URLs
• open(_:options:completionHandler:)
Windows
• keyWindow
Replacement API NEW
• UIWindowScene.interfaceOrientation
Opening URLs
• UIWindowScene.open(_:options:completionHandler:)
Key Windows
• Track windows manually
Summary
Summary