Why do ARKit engineers put ARFaceTrackingConfiguration.isSupported
statement in AppDelegate.swift
file but not in ViewController.swift
file?
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
}
}
I think a ViewController.swift
file is the most suitable place for this conditional statement.
Am I right?