mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

This migrates Flutter to use the `@main` attribute introduced in Swift 5.3. The `@UIApplicationMain` attribute is deprecated and will be removed in Swift 6. See: https://github.com/apple/swift-evolution/blob/main/proposals/0383-deprecate-uiapplicationmain-and-nsapplicationmain.md This change is split into two commits: 1.ad18797428
- This updates the iOS app template and adds a migration to replace `@UIApplicationMain` uses with `@main`. 2.8ecbb2f29f
- I ran `flutter run` on each Flutter iOS app in this repository to verify the app migrates and launches successfully. Part of https://github.com/flutter/flutter/issues/143044
18 lines
556 B
Swift
18 lines
556 B
Swift
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import Flutter
|
|
import UIKit
|
|
|
|
@main
|
|
@objc class AppDelegate: FlutterAppDelegate {
|
|
override func application(
|
|
_ application: UIApplication,
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
|
) -> Bool {
|
|
GeneratedPluginRegistrant.register(with: self)
|
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
|
}
|
|
}
|