how to create apps on toolbar macos
Asked on 09/07/2024
1 search
To create apps with toolbars on macOS, you can utilize the enhancements to NSToolbar
as discussed in the session titled "What’s new in AppKit" at WWDC 2024. Here are some key points to consider:
-
Display Modes:
NSToolbar
now supports displaying items with and without text labels. This allows you to offer users a choice of style, even if the toolbar contents aren't customizable. You can enable this feature using theallowsDisplayModeCustomization
property, which is enabled by default. Ensure your toolbar has an identifier so that AppKit can save the style preference. -
Item Identifiers: You can use the new
itemIdentifiers
property to set a toolbar's item identifiers automatically, which provides a convenience over the existing items property. -
SwiftUI Integration: You can incrementally adopt SwiftUI with new menu and animation APIs, which can be integrated into your toolbar design.
For more detailed guidance, you can refer to the session What’s new in AppKit (15:21) where toolbar refinements are discussed.

What’s new in AppKit
Discover the latest advances in Mac app development. Get an overview of the new features in macOS Sequoia, and how to adopt them in your app. Explore new ways to integrate your existing code with SwiftUI. Learn about the improvements made to numerous AppKit controls, like toolbars, menus, text input, and more.

Bring your app’s core features to users with App Intents
Learn the principles of the App Intents framework, like intents, entities, and queries, and how you can harness them to expose your app’s most important functionality right where people need it most. Find out how to build deep integration between your app and the many system features built on top of App Intents, including Siri, controls and widgets, Apple Pencil, Shortcuts, the Action button, and more. Get tips on how to build your App Intents integrations efficiently to create the best experiences in every surface while still sharing code and core functionality.

What’s new in SwiftUI
Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.