NACCAppSceneDelegate
@UIApplicationMain
class NACCAppSceneDelegate : UIResponder
extension NACCAppSceneDelegate: UIApplicationDelegate
extension NACCAppSceneDelegate: UIWindowSceneDelegate
This is a simple application delegate that allows the app to start up.
-
Used for when we store the original state of the app, when called from a URI.
Declaration
Swift
typealias OriginalPrefsTuple = (cleanDate: Date, lastSelectedTabIndex: NACCTabBarController.TabIndexes)
-
Required Window Property
Declaration
Swift
var window: UIWindow?
-
Quick accessor for the app delegate, cast to this class.
Declaration
Swift
private static var _appDelegateInstance: NACCAppSceneDelegate?
-
The name of our default scene configuration.
Declaration
Swift
private static let _sceneConfigurationName: String
-
This will contain the original prefs, if the app was started from a URL (so we reset).
Declaration
Swift
private static var _originalPrefs: OriginalPrefsTuple?
-
This is a special flag, for use when opened by a URI. If true, then the app always starts at the initial screen.
Declaration
Swift
private var _resetScreen: Bool
-
This is used to allow a tab to be selected from the URL.
Declaration
Swift
private var _selectedTabFromURI: NACCTabBarController.TabIndexes?
-
This will contain the date for the selectors.
Declaration
Swift
private var _date: Date?
-
This will contain the textual report, for the calculation.
Declaration
Swift
private var _report: String
-
Easy access to our navigation controller.
Declaration
Swift
private var _navigationController: UINavigationController? { get }
-
This is the initial view controller.
Declaration
Swift
private var _initialViewController: NACCInitialViewController? { get }
-
Quick accessor for the app delegate, cast to this class. READ-ONLY.
Declaration
Swift
class var appDelegateInstance: NACCAppSceneDelegate? { get }
-
This will contain the date for the selectors.
Declaration
Swift
var date: Date? { get set }
-
This will contain the textual report, for the calculation.
Declaration
Swift
var report: String { get set }
-
This clears the original prefs, and prevents the reset on close.
Declaration
Swift
func clearOriginalPrefs()
-
This will open and set up the app, in response to a URL.
We parse the URL, and set a couple of instance variables, if the URL parameters are correct.
The URL scheme is thus:
nacc://[YYYY-MM-DD[/N]]
The Universal Link Scheme is:
https://nacc.littlegreenviper.com/_[YYYY-MM-DD[/N]]_
YYYY-MM-DD is a standard ISO 8601 calendar date (For example, September first, 1980, is 1980-09-01).
The earliest date is October 5, 1953 (1953-10-05)
N is the numerical index of a tab:
- 0 is Keytag Array
- 1 is Keytag Strip
2 is Medallions
Declaration
Swift
func resolveURL(_ inURL: URL)
Parameters
inURL
The URL to be parsed.
-
Called when the application starts.
Declaration
Swift
func application(_: UIApplication, didFinishLaunchingWithOptions: [UIApplication.LaunchOptionsKey : Any]?) -> Bool
Return Value
true, always.
-
Declaration
Swift
func application(_: UIApplication, configurationForConnecting inConnectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration
Parameters
configurationForConnecting
options
Return Value
The scene configuration.
-
Called when the app is foregrounded via a URL.
Declaration
Swift
func scene(_: UIScene, openURLContexts inURLContexts: Set<UIOpenURLContext>)
Parameters
openURLContexts
The Opening URL contexts (as a set).
-
Called when the app is opened via a URL from a “cold start.”
Declaration
Swift
func scene(_ inScene: UIScene, willConnectTo: UISceneSession, options inConnectionOptions: UIScene.ConnectionOptions)
Parameters
willConnectTo
The session being connected (ignored).
options
This contains the options, among which, is the URL context.
-
Called when the app is opened via a URL (and launched).
Declaration
Swift
func scene(_: UIScene, continue inUserActivity: NSUserActivity)
Parameters
continue
The activity being continued.
-
Called when the app is about to come into the foreground.
We use this to set the app to the initial screen, and also, to check if we have a URL specified.
If we don’t have a URL specified, then we restore to any saved state.
Declaration
Swift
func sceneWillEnterForeground(_: UIScene)
-
Called when the app is about to come into the foreground.
We use this to set the app to the initial screen, and also, to check if we have a URL specified.
If we don’t have a URL specified, then we restore to any saved state.
Declaration
Swift
func sceneDidBecomeActive(_: UIScene)
-
Called when the scene will be no longer visible.
We use this to restore our prefs from any that were stored, when the app was called from a URL.
Declaration
Swift
func sceneDidEnterBackground(_: UIScene)