Skip to content

Latest commit

 

History

History
169 lines (124 loc) · 6.02 KB

README.md

File metadata and controls

169 lines (124 loc) · 6.02 KB

AppKitPlus

Binary distribution of AppKitPlus — an Objective-C framework that ports modern UIKit APIs to AppKit, so macOS code can use familiar UIKit patterns.

Warning

AppKitPlus is in testing. No API or ABI stability is promised. Any release may remove classes, change type layouts, or change protocol requirements, with no deprecation period. Pin an exact version and read the release notes before upgrading.

This repository contains only the Swift Package manifest. The framework's source lives in a separate, private repository; each release here ships a prebuilt AppKitPlus.xcframework.

Installation

dependencies: [
    .package(url: "https://github.com/AppKitSupportProgram/AppKitPlus-Release", from: "0.1.0"),
]

Then add the product to your target:

.target(name: "YourTarget", dependencies: ["AppKitPlus"])

In Xcode: File ▸ Add Package Dependencies… and enter the repository URL.

import AppKitPlus

The module is named AppKitPlus — the -Release suffix belongs to the repository, not to the package or the product.

Requirements

Platform AppKitPlus: macOS 14.0 or later; UIKitPlus: iOS 17.0 or later, visionOS 1.0 or later
Architectures macOS: arm64, arm64e, x86_64; iOS and visionOS: arm64, plus x86_64 in the simulators
Xcode 27.2 or later
Swift 5 language mode (built with library evolution enabled)
Package manifest swift-tools-version 5.9 (Xcode 15+)

Embedding

AppKitPlus.framework is a dynamic framework (mh_dylib). Swift Package Manager embeds and signs it into an application target automatically. If you integrate the .xcframework by hand instead, set it to Embed & Sign in your target's Frameworks, Libraries, and Embedded Content — linking without embedding builds fine and then fails at launch.

Agent Plugin

The appkitplus plugin gives Claude Code and Codex the appkit-app-modernization skill, which writes and migrates AppKit code to use AppKitPlus. The plugin's version is the release it describes.

Claude Code, in a session:

/plugin marketplace add AppKitSupportProgram/AppKitPlus-Release
/plugin install appkitplus@appkitplus

Codex:

codex plugin marketplace add AppKitSupportProgram/AppKitPlus-Release
codex plugin add appkitplus@appkitplus

To update after a release:

claude plugin marketplace update appkitplus && claude plugin update appkitplus@appkitplus
codex plugin marketplace upgrade appkitplus

What's included

Ports of UIKit's content configurations, background configurations, cell accessories, button configuration, trait collection, navigation controller and bars, view controller transitioning, diffable data sources for NSOutlineView, drag and drop interactions, graphics renderers, focus engine, document launch experience, and more.

UIKitPlus

The package has a second product, UIKitPlus: the navigation popover, the pop-up path control, the filter fields with the filter control bar, and the icons, built for UIKit — iOS 17 and visionOS 1 or later; there is no Mac Catalyst slice. It is built from the same sources as AppKitPlus and released with it, so both products always carry the same version. The classes have the same names on iOS — NSNavigationPopoverController, NSPopUpPathControl, NSFilterSearchField, NSFilterTokenField, NSFilterControlBar, NSIcon and NSIconView; each header says where a class differs on iOS.

.target(name: "YourTarget", dependencies: [
    .product(name: "UIKitPlus", package: "AppKitPlus-Release"),
])
import UIKitPlus

UIKitPlus.framework is a dynamic framework too; embed and sign it as described above. Swift Package Manager downloads both frameworks when it resolves this package, whichever product a target uses.

Linking AppKitPlus statically

AppKitPlusStatic is the same framework as a static library, for a command-line tool, a plugin, or an app that ships a single executable. It is imported as AppKitPlus; only the product name changes:

.target(name: "YourTarget", dependencies: [
    .product(name: "AppKitPlusStatic", package: "AppKitPlus-Release"),
])
  • Depend on AppKitPlus or AppKitPlusStatic, not both, and link AppKitPlus into only one binary of a process.
  • A target that calls nothing of AppKitPlus but category methods also needs -ObjC in Other Linker Flags.
  • Your app's dSYM names AppKitPlus's functions in crash reports, without line numbers.
  • NSObjectGridGraph finds its SpriteKit resources in the AppKitPlus.framework Xcode embeds in your app; a command-line tool has none, and its graph views stay empty.

SwiftUI content in cells

AppKitPlusSwiftUI holds the part of AppKitPlus that needs SwiftUI — NSHostingConfiguration, and the bridge between trait collections and SwiftUI environments (NSTraitBridgedEnvironmentKey, EnvironmentValues.hostTraitCollection, resolvedTraitCollection) — so that AppKitPlus itself never links SwiftUI. Its product brings AppKitPlus along:

.target(name: "YourTarget", dependencies: [
    .product(name: "AppKitPlusSwiftUI", package: "AppKitPlus-Release"),
])
import AppKitPlus
import AppKitPlusSwiftUI
import SwiftUI

cell.contentConfiguration = NSHostingConfiguration { Text("Row") }
  • With AppKitPlusStatic, depend on AppKitPlusSwiftUIStatic instead. Do not mix a dynamic product with a static one.
  • Before this release NSHostingConfiguration was part of AppKitPlus; code that uses it now also imports AppKitPlusSwiftUI.

Releases

Version macOS Swift Built with
0.1.0 12.0+ 5 Xcode 26.6
0.24.0 14.0+ 5 Xcode 27.2

A binary framework's .swiftinterface is not guaranteed to be readable by every future compiler, so the Xcode version each release was built with is recorded here.

License

AppKitPlus is released under the MIT License — see LICENSE.

The framework statically incorporates third-party code under a different license. See NOTICE.