toolbar
is dependent upon the navigation bar so you must have a NavigationView
/NavigationStack
https://developer.apple.com/documentation/swiftui/view/toolbar(content material:)-5w0tj
struct ToolbarSolutionView: View {
var physique: some View {
NavigationView{ //NavigationStack
Textual content("Content material")
.toolbar {
ToolbarItemGroup(placement: .bottomBar) {
Button("Greeting") {
print("Hiya world!")
}
}
}
}
}
}
It was seemingly a bug that it was working earlier than.
You’ll be able to conceal the navigation bar for those who do not want it.
//iOS 13+
.navigationBarHidden(true)
//iOS 16+
.toolbar(.hidden, for: .navigationBar)