在 Swift 官方文档中介绍:
Apply this attribute to a class to indicate that it’s the application delegate. Using this attribute is equivalent to calling the UIApplicationMain
function and passing this class’s name as the name of the delegate class.
If you don’t use this attribute, supply a main.swift
file with code at the top level that calls the UIApplicationMain(::::)
function. For example, if your app uses a custom subclass of UIApplication
as its principal class, call the UIApplicationMain(::::)
function instead of using this attribute.