为什么 "ARFaceTrackingConfiguration.isSupported" 语句在 AppDelegate 中,而不是在 ViewController 中?

Why "ARFaceTrackingConfiguration.isSupported" statement is in AppDelegate, not in ViewController?

为什么ARKit工程师将ARFaceTrackingConfiguration.isSupported语句放在AppDelegate.swift文件中而不是ViewController.swift文件中?

class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?

    func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {

        if !ARFaceTrackingConfiguration.isSupported {               
            let storyboard = UIStoryboard(name: "Main", bundle: nil)
            window?.rootViewController = storyboard.instantiateViewController(withIdentifier: "unsupportedDeviceMessage")
        }
        return true
    }
}

我认为ViewController.swift文件是这个条件语句最合适的地方。

我说得对吗?

经过调查,我决定 application(_:willFinishLaunchingWithOptions:) 实例方法更适合在检查 ARFaceTrackingConfiguration.[=13 的 if 语句中实例化故事板(然后呈现 ViewController) =]

以下是 Apple 对这种方法的评价:

Use this instance method to initialise your app and prepare it to run. This method is called after your app has been launched and its main storyboard or nib file has been loaded, but before your app’s state has been restored. At the time this method is called, your app is in the inactive state.