AppKit or SwiftUI: which should you use?
Choose a tool for a new Mac app, an older codebase, or an app that uses both.
Try SwiftUI first for a new app
SwiftUI lets you describe what the screen should show for each state. Many ideas also work on iPhone, iPad, and other Apple devices. It is a good first choice when the app state is clear and SwiftUI has the controls you need.
- Good for: new screens, layouts that change with window size, previews, and UI shared across Apple devices.
- Watch out: a new API may be missing a feature or may change. You might need some Mac-only code.
Use AppKit when Mac behavior matters most
AppKit gives you direct control of Mac windows, documents, menus, text, tables, and panels. It is often safer for deep desktop features or an app that already uses AppKit. It also helps when focus and window behavior must be exact.
- Good for: document apps, advanced text tools, large tables, custom windows, and older native code.
- Watch out: you may write more step-by-step code, and less UI can be shared with other Apple devices.
You can use both
Apple lets you put SwiftUI inside AppKit and AppKit inside SwiftUI. Split them by whole feature. Decide which side owns the data and keyboard focus, then test what happens when the feature opens, closes, and updates. Do not switch tools for every small control.