2019-06-28 17:28:02 +02:00
|
|
|
//
|
|
|
|
// AppDelegate.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 6/28/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
2019-06-29 20:35:12 +02:00
|
|
|
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
|
|
|
|
2019-06-28 17:28:02 +02:00
|
|
|
var window: UIWindow?
|
2019-07-19 18:59:08 +02:00
|
|
|
var coordinator: AppCoordinator?
|
|
|
|
|
2019-06-28 17:28:02 +02:00
|
|
|
// UIWindowScene delegate
|
|
|
|
|
|
|
|
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
|
|
|
|
|
|
|
window!.tintColor = AppAssets.netNewsWireBlueColor
|
2019-07-19 18:59:08 +02:00
|
|
|
coordinator = AppCoordinator(window!.rootViewController as! UISplitViewController)
|
2019-06-28 17:28:02 +02:00
|
|
|
|
|
|
|
// if let userActivity = connectionOptions.userActivities.first ?? session.stateRestorationActivity {
|
|
|
|
// if !configure(window: window, with: userActivity) {
|
|
|
|
// print("Failed to restore from \(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 sceneDidEnterBackground(_ scene: UIScene) {
|
|
|
|
appDelegate.prepareAccountsForBackground()
|
|
|
|
}
|
|
|
|
|
|
|
|
func sceneWillEnterForeground(_ scene: UIScene) {
|
|
|
|
appDelegate.prepareAccountsForForeground()
|
|
|
|
}
|
|
|
|
|
|
|
|
// func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? {
|
|
|
|
// 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
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|