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 `@NSApplicationMain` 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.a508d3e503
- This updates the macOS app template and adds a migration to replace `@NSApplicationMain` uses with `@main`. 2.f43482786e
- I ran `flutter run -d macos` on each Flutter macOS app in this repository to verify the app migrates and launches successfully. Follow-up to https://github.com/flutter/flutter/pull/146707 Fixes https://github.com/flutter/flutter/issues/143044
14 lines
366 B
Swift
14 lines
366 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 Cocoa
|
|
import FlutterMacOS
|
|
|
|
@main
|
|
class AppDelegate: FlutterAppDelegate {
|
|
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
|
return true
|
|
}
|
|
}
|