0%

SwiftUI lifecycle or UIKit lifecycle

新建项目的时候会出现这个选择,到底怎么选呢,有什么区别。。

With SwiftUI you should in most cases use SwiftUI lifecycle.

If you need some AppDelegate methods you can use @UIApplicationDelegateAdaptor:

SwiftUI app life cycle iOS14 where to put AppDelegate code?

There are some cases, however, when you need UIKit lifecycle:

access to SceneDelegate (see Is there any way to call SceneDelegate methods in iOS 14 app life cycle?)
deployment target iOS 13 (SwiftUI lifecycle is available on iOS 14+).