# Deprecate @UIApplicationMain and @NSApplicationMain

**URL:** <https://forums.swift.org/t/deprecate-uiapplicationmain-and-nsapplicationmain/61493>\
**Category:** Pitches\
**Created:** [November 17, 2022, 2:29am UTC](https://forums.swift.org/t/deprecate-uiapplicationmain-and-nsapplicationmain/61493 "2022-11-17T02:29:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![codafi](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/codafi/32/791_2.png) [@codafi](https://forums.swift.org/u/codafi)\
**Post date:** [November 17, 2022, 2:29am UTC](https://forums.swift.org/t/deprecate-uiapplicationmain-and-nsapplicationmain/61493/1 "2022-11-17T02:29:40Z")

</div>

Hello Swift Community,

I wanted to kick off a discussion about the deprecation and eventual removal of the framework-specific entrypoint attributes `@UIApplicationMain` and `@NSApplicationMain`. To offer a brief background, these attributes were introduced with Swift 1.1 to make it far simpler to write an app entirely in Swift. Before that, the main entrypoint was either contained in a `main.swift` or an Objective-C `.m` file that called `UIApplicationMain` or `NSApplicationMain` as appropriate. Even for apps written entirely in Swift, I'm sure some of us can recall having to manually call these entrypoints with the (then) `CommandLine` type's data and how awkward that was.

With the advent of [SE-0281](https://github.com/apple/swift-evolution/blob/main/proposals/0281-main-attribute.md) and the enthusiastic adoption of type-based entrypoints by SwiftUI, AppKit, and UIKit, I feel that it's time to begin a discussion about removing the hard-coded framework-specific attributes from the language.

A draft copy of the proposal text can be found [in this gist](https://gist.github.com/CodaFi/ab33a7ce111942db045641efcdfd2de2). The implementation is mostly noise in tests since this proposal is just about a diagnostic, but [it can be found here](https://github.com/apple/swift/pull/62151)

---

<div class="post-metadata">

**Author:** ![tstromberg](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tstromberg/32/18093_2.png) [@tstromberg](https://forums.swift.org/u/tstromberg)\
**Post date:** [November 22, 2022, 8:14pm UTC](https://forums.swift.org/t/deprecate-uiapplicationmain-and-nsapplicationmain/61493/3 "2022-11-22T20:14:07Z")

</div>

I am all for removing these and reducing the potential confusion between these attributes.

---

<div class="post-metadata">

**Author:** ![tonyarnold](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tonyarnold/32/30924_2.png) [@tonyarnold](https://forums.swift.org/u/tonyarnold)\
**Post date:** [November 22, 2022, 8:18pm UTC](https://forums.swift.org/t/deprecate-uiapplicationmain-and-nsapplicationmain/61493/4 "2022-11-22T20:18:44Z")

</div>

This seems like a “no-brainer” to me. 👍

---

<div class="post-metadata">

**Author:** ![Kyle-Ye](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kyle-ye/32/19686_2.png) [@Kyle-Ye](https://forums.swift.org/u/Kyle-Ye)\
**Post date:** [November 23, 2022, 6:10am UTC](https://forums.swift.org/t/deprecate-uiapplicationmain-and-nsapplicationmain/61493/5 "2022-11-23T06:10:52Z")

</div>

I was wondering when we can remove `@GKInspectable `, `@IBInspectable` and `@IBOutlet ` stuff too.

Maybe there is a property wrapper solution for them. They should be part of the `GameplayKit` SDK and storyboard related SDK (UIKit or AppKit) instead of being part of Swift.

---

<div class="post-metadata">

**Author:** ![jrose](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jrose/32/408_2.png) [@jrose](https://forums.swift.org/u/jrose)\
**Post date:** [November 23, 2022, 6:23am UTC](https://forums.swift.org/t/deprecate-uiapplicationmain-and-nsapplicationmain/61493/6 "2022-11-23T06:23:44Z")

</div>

Those are a bit trickier because they imply `@objc` (possibly even `@objc dynamic` for the inspectable ones, I don’t remember offhand). But I agree that they do feel like they should be defined in libraries rather than built-in, if we had that capability.

---

<div class="post-metadata">

**Author:** ![codafi](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/codafi/32/791_2.png) [@codafi](https://forums.swift.org/u/codafi)\
**Post date:** [December 14, 2022, 5:25am UTC](https://forums.swift.org/t/deprecate-uiapplicationmain-and-nsapplicationmain/61493/7 "2022-12-14T05:25:58Z")

</div>

Since this proposal is just _sooo_ controversial, I'm [committing it](https://github.com/apple/swift-evolution/pull/1881). Thanks everybody for the positive sentiments.
