I have been playing around with the new toolbar in SwiftUI but it looks like it has some issues with the Catalyst (iPad works fine). Does anyone else experience the same issue? Here's my code:
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationStack {
List {
Text("1")
Text("2")
Text("3")
Text("4")
Text("5")
}.toolbar(id: "ytuj") {
ToolbarItem(id: "1", placement: .primaryAction) {
Image(systemName: "heart")
}
ToolbarItem(id: "2", placement: .primaryAction) {
Image(systemName: "heart")
}
ToolbarItem(id: "3", placement: .secondaryAction) {
Image(systemName: "heart.fill")
}
ToolbarItem(id: "4", placement: .secondaryAction, showsByDefault: false) {
Image(systemName: "heart.fill")
}
}.toolbarRole(.editor)
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
If you run this on a Catalyst it crashes when trying to customize the toolbar. Am I doing something wrong?
Thank you
EDIT: here's the error of the crash which is super-weird! This is just a simple "hello-world" app...
*** Assertion failure in -[NSPasteboardItem setPropertyList:forType:], NSPasteboardItem.m:210