Deprecate @UIApplicationMain and @NSApplicationMain
About 1 min
Deprecate @UIApplicationMain and @NSApplicationMain 관련
HACKING WITH SWIFT
What's new in Swift?
Deprecate @UIApplicationMain and @NSApplicationMain | Changes in Swift 5.10
Deprecate @UIApplicationMain and @NSApplicationMain
Available from Swift 5.10
SE-0383 (apple/swift-evolution
) formally deprecates the @UIApplicationMain
and @NSApplicationMain
attributes, encouraging folks to switch across to the general-purpose @main
attribute that was introduced back in Swift 5.3.
Adopting this change is trivial. You should be able to change this code:
import SwiftUI
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
// your code here
}
To this:
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
// your code here
}
Or if you're using SwiftUI, just this:
@main
struct SandboxApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Other Changes in Swift 5.10
Data races are now clearly diagnosed | Changes in Swift 5.10
Data races are now clearly diagnosed
Allow Protocols to be Nested in Non-Generic Contexts | Changes in Swift 5.10
Allow Protocols to be Nested in Non-Generic Contexts
Refined actor initialization and deinitialization | Changes in Swift 5.10
Refined actor initialization and deinitialization