Making a State variable of ToolbarContent SwiftUI

I am working on a SwiftUI project, and I am trying to have multiple different Toolbar versions in my app. When one button is pressed, they ideally should change. So, I have defined a few different Toolbars using this definition (the actual code in the toolbars is not important): @ToolbarContentBuilder fileprivate var ______: some ToolbarContent… Read More Making a State variable of ToolbarContent SwiftUI

Why the Label text disappear when adding its View in a toolbar?

I created a View that displays a button which has a Label with name and icon. struct NewWordButtonView: View { @State var isAlert: Bool = false var body: some View { Button { isAlert.toggle() } label: { Label("change word", systemImage: "arrow.triangle.2.circlepath").fixedSize() } .buttonStyle(.bordered) } } And it should look like this: But when I add… Read More Why the Label text disappear when adding its View in a toolbar?