# \#appkit

**URL:** https://forums.swift.org/tag/appkit/288.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [Xcode 26.1 can't subclass NSMenuItem](https://forums.swift.org/t/xcode-26-1-cant-subclass-nsmenuitem/83078)

<div class="topic-metadata">

**Author:** [@RezaA](https://forums.swift.org/u/RezaA)\
**Replies:** 7\
**Last updated:** [November 7, 2025, 6:15pm UTC](https://forums.swift.org/t/xcode-26-1-cant-subclass-nsmenuitem/83078 "2025-11-07T18:15:14Z")

</div>

In Xcode 26.1, for a project with “Swift Language Version” set to swift6 I am getting for the following code I get errors: Error1: Main actor-isolated initializer 'init(title:action:keyEquivalent:)' has different actor …

---

## [Swift package: Colors](https://forums.swift.org/t/swift-package-colors/74824)

<div class="topic-metadata">

**Author:** [@0xWDG](https://forums.swift.org/u/0xWDG)\
**Replies:** 0\
**Last updated:** [September 21, 2024, 9:18am UTC](https://forums.swift.org/t/swift-package-colors/74824 "2024-09-21T09:18:33Z")

</div>

If you are developing for multiple Apple patforms, you may have noticed that when it comes to Colors, there are some differences between the different platforms. For example, the UIColor class is used in iOS, NSColor in…

---

## [How to program (and teach programming) using value semantics](https://forums.swift.org/t/how-to-program-and-teach-programming-using-value-semantics/53566)

<div class="topic-metadata">

**Author:** [@dabrahams](https://forums.swift.org/u/dabrahams)\
**Replies:** 14\
**Last updated:** [June 29, 2024, 6:29am UTC](https://forums.swift.org/t/how-to-program-and-teach-programming-using-value-semantics/53566 "2024-06-29T06:29:51Z")

</div>

Starting a new thread to continue a discussion started here: Introducing Swift in higher education It's API-decoupled through use of a name; you can always change the typealias definition later. Of course if you need …

---

## [How to detect if focused has changed on Mac OS](https://forums.swift.org/t/how-to-detect-if-focused-has-changed-on-mac-os/66424)

<div class="topic-metadata">

**Author:** [@BadPistol97](https://forums.swift.org/u/BadPistol97)\
**Replies:** 1\
**Last updated:** [July 28, 2023, 7:58am UTC](https://forums.swift.org/t/how-to-detect-if-focused-has-changed-on-mac-os/66424 "2023-07-28T07:58:44Z")

</div>

Is there any API to detect if the focus has changed to other apps on MacOS? I need to know when is the focus taken and get the top app name so I can clear the floating panels on the last focused app.

---

## [Auto scrolling using touchpad in Swift AppKit on MacOS](https://forums.swift.org/t/auto-scrolling-using-touchpad-in-swift-appkit-on-macos/66361)

<div class="topic-metadata">

**Author:** [@sarensw](https://forums.swift.org/u/sarensw)\
**Replies:** 0\
**Last updated:** [July 25, 2023, 4:05pm UTC](https://forums.swift.org/t/auto-scrolling-using-touchpad-in-swift-appkit-on-macos/66361 "2023-07-25T16:05:22Z")

</div>

For a NSScrollView in Swift AppKit for MacOS, I want to be able to scroll through the list while dragging an object (e.g. file). It works using a mouse using the scroll wheel. With touch pad, it won't. My assumption is t…

---

## [SE-0383: Deprecate \`@UIApplicationMain\` and \`@NSApplicationMain\`](https://forums.swift.org/t/se-0383-deprecate-uiapplicationmain-and-nsapplicationmain/62375)

<div class="topic-metadata">

**Author:** [@John\_McCall](https://forums.swift.org/u/John_McCall)\
**Replies:** 11\
**Last updated:** [January 18, 2023, 11:19pm UTC](https://forums.swift.org/t/se-0383-deprecate-uiapplicationmain-and-nsapplicationmain/62375 "2023-01-18T23:19:57Z")

</div>

Hello, Swift community! The review of SE-0383: Deprecate @UIApplicationMain and @NSApplicationMain begins now and runs through January 16th, 2023. Reviews are an important part of the Swift evolution process. All revie…

---

## [\[Accepted\] SE-0383: Deprecate \`@UIApplicationMain\` and \`@NSApplicationMain\`](https://forums.swift.org/t/accepted-se-0383-deprecate-uiapplicationmain-and-nsapplicationmain/62645)

<div class="topic-metadata">

**Author:** [@John\_McCall](https://forums.swift.org/u/John_McCall)\
**Replies:** 0\
**Last updated:** [January 18, 2023, 11:19pm UTC](https://forums.swift.org/t/accepted-se-0383-deprecate-uiapplicationmain-and-nsapplicationmain/62645 "2023-01-18T23:19:34Z")

</div>

Hello, Swift community. The review of SE-0383 ran from January 3rd through January 16th, 2023. Feedback in the review was light but strongly positive, and the Language Workgroup agrees with the community that this is a…

---

## [How to get item info for Outlook attachments dropped onto a view\_](https://forums.swift.org/t/how-to-get-item-info-for-outlook-attachments-dropped-onto-a-view/61312)

<div class="topic-metadata">

**Author:** [@sarensw](https://forums.swift.org/u/sarensw)\
**Replies:** 0\
**Last updated:** [November 8, 2022, 7:59pm UTC](https://forums.swift.org/t/how-to-get-item-info-for-outlook-attachments-dropped-onto-a-view/61312 "2022-11-08T19:59:43Z")

</div>

Goal: When you drag&drop an attachment from an outlook email to a Finder window, then this attachment is copied to that folder. I want to do the same when such an attachment is dropped onto my view. Current Situation: …

---

## [@MainActor app delegate](https://forums.swift.org/t/mainactor-app-delegate/55292)

<div class="topic-metadata">

**Author:** [@pelea](https://forums.swift.org/u/pelea)\
**Replies:** 4\
**Last updated:** [August 30, 2022, 11:09pm UTC](https://forums.swift.org/t/mainactor-app-delegate/55292 "2022-08-30T23:09:28Z")

</div>

My app delegate is marked as @MainActor. @main @MainActor class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(\_ aNotification: Notification) { // Insert code here to init…

---

## [Upgrading search example to Xcode 11 and Swift 5](https://forums.swift.org/t/upgrading-search-example-to-xcode-11-and-swift-5/39294)

<div class="topic-metadata">

**Author:** [@Eagle442BR](https://forums.swift.org/u/Eagle442BR)\
**Replies:** 2\
**Last updated:** [August 12, 2020, 10:37am UTC](https://forums.swift.org/t/upgrading-search-example-to-xcode-11-and-swift-5/39294 "2020-08-12T10:37:49Z")

</div>

I found the following code of a search example, but it was for Xcode 8 which I don't have compatible macOS to upgrade. So, I was trying to upgrade manually, I got most of it changed but still have one error to get by to…

---

## [Is the Encodable/Decodable system safe for asynchronous NSDocument handling?](https://forums.swift.org/t/is-the-encodable-decodable-system-safe-for-asynchronous-nsdocument-handling/34816)

<div class="topic-metadata">

**Author:** [@CTMacUser](https://forums.swift.org/u/CTMacUser)\
**Replies:** 1\
**Last updated:** [March 26, 2020, 1:59pm UTC](https://forums.swift.org/t/is-the-encodable-decodable-system-safe-for-asynchronous-nsdocument-handling/34816 "2020-03-26T13:59:37Z")

</div>

I was just reading up on AppKit again and saw that the NSDocument system allows asynchronous loading and saving. If I use a Codable type for my model data, is the data translation safe to use in the background? How much…

---

## [How to conform NSView to CALayerDelegate when you import SwiftUI?](https://forums.swift.org/t/how-to-conform-nsview-to-calayerdelegate-when-you-import-swiftui/29970)

<div class="topic-metadata">

**Author:** [@shpakovski](https://forums.swift.org/u/shpakovski)\
**Replies:** 2\
**Last updated:** [October 19, 2019, 3:51pm UTC](https://forums.swift.org/t/how-to-conform-nsview-to-calayerdelegate-when-you-import-swiftui/29970 "2019-10-19T15:51:14Z")

</div>

This compiles: import AppKit class CustomView: NSView, CALayerDelegate {} This does not however: import AppKit import SwiftUI class CustomView: NSView, CALayerDelegate {} This is an error: ... error: redundant con…
