I want control my user device if they got (iOS 14.0, *)
, if that condition is true I want use App protocol, if the user device is lower than 14.0 but it has (iOS 13.0, *)
then I want use AppDelegate with SceneDelegate, here what I did, I cannot code from (iOS 13.0, *)
if I chose SwiftUI-life-cycle, because the App protocol need (iOS 14.0, *)
, then I end up to creating a UIKit-life-cycle to be able code for (iOS 13.0, *)
, so far so good, but I want control the user device in my UIKit-life-cycle app if they have (iOS 14.0, *)
, if that is true I want change the logic of my app to use App protocol instead of AppDelegate with SceneDelegate, is it possible to do such thing?
Here I add this below code as a file to my project in the same time the AppDelegate and SceneDelegate exist:
import SwiftUI
@available(iOS 14.0, *)
@main
struct MyTestApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
error:
'main()' is only available in iOS 14.0 or newer
How can I make my app smart to know that for (iOS 13.0, *)
to < (iOS 14.0, *)
should use AppDelegate and SceneDelegate and for (iOS 14.0, *)
should use App protocol.