Natalia Panferova: I thought it would be useful to have a single reference for the different ways we can style the toolbar in SwiftUI on macOS 26. Phil Zakharchenko: The toolbar id creates a stable customization domain, and each item id gives the framework something stable to persist when the user adds, removes, or reorders […]
I thought it would be useful to have a single reference for the different ways we can style the toolbar in SwiftUI on macOS 26.
The toolbar
idcreates a stable customization domain, and each itemidgives the framework something stable to persist when the user adds, removes, or reorders controls. This identifiability of toolbar items is a requirement for customization. Under the hood, when SwiftUI inevitably bridges your toolbar contents toNSToolbar, these identifiers will be directly translated to theNSToolbarItem’sitemIdentifiers.As we continue the migration to a customizable toolbar, we are likely to encounter a few surprises related to this model.
[…]
After a closer inspection, and perhaps a few minutes of digging through the documentation, we come to the bleak realization: there is no customizable
ToolbarItemGroupAPI.[…]
The regular toolbar model and the customizable toolbar model overlap, but they are not interchangeable. You cannot give a
ToolbarItemGroupanid, and you cannot place one directly insidetoolbar(id:content:).
Let’s take a look at another example. This one is a bit tricky, because on macOS, you will get Action 1 in the top trailing position and the whole group of actions centered in the navigation bar. On iOS, you will get Action 1 pinned to trailing and all other items collapsed.
[…]
The final addition to the Toolbar API is the toolbarMinimizeBehavior view modifier allowing us to minimize toolbars while scrolling up or down. You can minimize tab, bottom, window and navigation bars with it.
With new modifiers SwiftUI gives us a much better balance between system-driven adaptation and explicit control. We can now decide which actions are more important, which items should always stay visible, which groups should intentionally live in the overflow menu, and how toolbars should react to scrolling.
iOS 27 includes a few smaller additions that make toolbar content easier to configure.
We can remove the default padding around an item whose content should extend to its edges with contentMarginsRemoved(_:)[…]
[…]
The status bar is now represented by ToolbarPlacement.statusBar, so its visibility can be controlled through the same toolbar API as other bars[…]
[…]
ForEach now conforms to ToolbarContent, which means we can generate toolbar items directly from a collection[…]
Together, the toolbar APIs let us express the importance of each action while SwiftUI continues to handle the toolbar’s layout across different sizes.
Previously:
iOS iOS 27 Mac macOS 27 Golden Gate Programming Swift Programming Language SwiftUI
2 Comments| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | NSToolbar in Golden Gate | 0 | 13.12 | 08-09-2026 |
| 2 | Backporting SwiftUI APIs | 0 | 13.74 | 30-09-2026 |
| 3 | Developing for iPhone Duo | 0 | 9.71 | 11-09-2026 |
| 4 | TipKit for the Real World | 0 | 13.84 | 01-09-2026 |
| 5 | Xcode 27 RC Released | 0 | 20.19 | 14-09-2026 |
| 6 | iOS 27 | 0 | 18.26 | 14-09-2026 |
| 7 | How to Always Show Menu Bar on iPad with iPadOS 27 | 0 | 5.31 | 23-09-2026 |
| 8 | Xcode 27.1 Beta 1 Released | 0 | 19.59 | 22-09-2026 |
| 9 | Accessing the Keychain Without the Password | 0 | 13.08 | 01-10-2026 |
| 10 | Xcode 27 Released | 0 | 20.19 | 14-09-2026 |