Post

Replies

Boosts

Views

Activity

Reply to SwiftUI - Placing ToolbarItem on .keyboard does not work
I am also seeing a variety of this problem - the toolbar appears, but there's no content in the toolbar. Code is below but the TL;DR is the same as F99's response above, removing the Spacer() from the HStack fixes the problem HStack { TextField(store.prompt, text: $input) .hideableToolbar(show: store.showToolbar) { ToolbarItemGroup(placement: .keyboard) { HStack { ForEach(fastList) { item in Button { // } label: { Text("\(item.name)") } } Spacer() // <–– COMMENTING OUT THIS LINE FIXES THE PROBLEM } } } } }
Jun ’24
Reply to SwiftUI Commands and StrictConcurrency Warnings Issue
I'm seeing a similar problem. Here I'm using an ObservedObject to update my app settings but get a build warning in the Command section Main actor-isolated property 'body' cannot be used to satisfy nonisolated protocol requirement The app seems to compile and run fine otherwise. Feedback raised: FB13801673 struct MyCommands: Commands { @ObservedObject var globalAppSettings: GlobalAppSettings var body: some Commands { SidebarCommands() CommandGroup(after: CommandGroupPlacement.newItem) { Divider() Toggle("Debug Mode", isOn: $globalAppSettings.debugMode) } } }
May ’24