我必须在 AppDelegate.swift 文件中写任何东西吗?
Do I have to write anything in AppDelegate.swift file?
我只是想知道在发布之前是否必须在我的 Xcode 项目的 AppDelegate.swift
文件中编写任何代码。当我不在 AppDelegate
.
中写任何内容时,是否有必要或应用程序是否可以正常工作
你必须吗?不,如果您查看 UIApplicationDelegate
协议,您会看到 none 的委托方法被标记为必需。它 class 是为了方便您设置应用程序而提供的。
Apple docs说得最好:
Launch time is an important point in an app’s life cycle. At launch time, the app delegate is responsible for executing any custom code required to initialize your app. For example, the app delegate typically creates the app’s initial data structures, registers for any required services, and tweaks the app’s initial user interface based on any available data.
我只是想知道在发布之前是否必须在我的 Xcode 项目的 AppDelegate.swift
文件中编写任何代码。当我不在 AppDelegate
.
你必须吗?不,如果您查看 UIApplicationDelegate
协议,您会看到 none 的委托方法被标记为必需。它 class 是为了方便您设置应用程序而提供的。
Apple docs说得最好:
Launch time is an important point in an app’s life cycle. At launch time, the app delegate is responsible for executing any custom code required to initialize your app. For example, the app delegate typically creates the app’s initial data structures, registers for any required services, and tweaks the app’s initial user interface based on any available data.