mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-10 00:50:55 +01:00
Handle user activities on a cold launch
This commit is contained in:
parent
415dcb46cb
commit
31715ad4f0
@ -16,20 +16,16 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|||||||
// UIWindowScene delegate
|
// UIWindowScene delegate
|
||||||
|
|
||||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||||
|
|
||||||
window = UIWindow(windowScene: scene as! UIWindowScene)
|
window = UIWindow(windowScene: scene as! UIWindowScene)
|
||||||
window!.tintColor = AppAssets.netNewsWireBlueColor
|
window!.tintColor = AppAssets.netNewsWireBlueColor
|
||||||
window!.rootViewController = coordinator.start()
|
window!.rootViewController = coordinator.start()
|
||||||
window!.makeKeyAndVisible()
|
window!.makeKeyAndVisible()
|
||||||
|
|
||||||
// if let userActivity = connectionOptions.userActivities.first ?? session.stateRestorationActivity {
|
if let userActivity = connectionOptions.userActivities.first ?? session.stateRestorationActivity {
|
||||||
// if !configure(window: window, with: userActivity) {
|
DispatchQueue.main.asyncAfter(deadline: .now()) {
|
||||||
// print("Failed to restore from \(userActivity)")
|
self.coordinator.handle(userActivity)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// If there were no user activities, we don't have to do anything.
|
|
||||||
// The `window` property will automatically be loaded with the storyboard's initial view controller.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
|
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
|
||||||
@ -47,24 +43,5 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|||||||
// func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? {
|
// func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? {
|
||||||
// return scene.userActivity
|
// return scene.userActivity
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// Utilities
|
|
||||||
|
|
||||||
// func configure(window: UIWindow?, with activity: NSUserActivity) -> Bool {
|
|
||||||
// if activity.title == GalleryOpenDetailPath {
|
|
||||||
// if let photoID = activity.userInfo?[GalleryOpenDetailPhotoIdKey] as? String {
|
|
||||||
//
|
|
||||||
// if let photoDetailViewController = PhotoDetailViewController.loadFromStoryboard() {
|
|
||||||
// photoDetailViewController.photo = Photo(name: photoID)
|
|
||||||
//
|
|
||||||
// if let navigationController = window?.rootViewController as? UINavigationController {
|
|
||||||
// navigationController.pushViewController(photoDetailViewController, animated: false)
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user