iOS 17 Toolbar Bugs

Since iOS 17, certain things in the toolbar do not work anymore.

In this example it is the following:

  • rotationEffect; scaleEffect, rotationEffect3D, foregroundStyle, foregroundColor and probably more on a button label do not work in iOS 17 but have the correct behavior in iOS 16

  • ToolbarItem(placement: .keyboard) does not work in iOS 17, works in iOS 16

Here is the minimal example:

struct ContentView: View {
    @State private var buttonRotation: CGFloat = 0
    @State private var isActive: Bool = false
    @State private var text: String = ""
    
    var body: some View {
        NavigationStack {
            VStack {
                Text("Hello, world!")
                TextField("Text here", text: $text)
            }
            .padding()
            .toolbar {
                ToolbarItem(placement: .topBarTrailing) {
                    Button(action: {
                        buttonRotation += 30
                        isActive.toggle()
                    }) {
                        Label("Info", systemImage: "info.circle")
                        // `rotationEffect` does not work in iOS 17, works in iOS 16
                        // the same for `scaleEffect`, `rotationEffect3D` and probably more
                            .rotationEffect(.degrees(buttonRotation))
                        // `foregroundStyle` & `foregroundColor` do not work in iOS 17, works in iOS 16
                            .foregroundStyle(isActive ? .purple : .accentColor)
                    }
                    // `tint` works in iOS 17 & 16
                    .tint(isActive ? .purple : .accentColor)
                }
                // `ToolbarItem(placement: .keyboard)` does not work in iOS 17, works in iOS 16
                ToolbarItem(placement: .keyboard) {
                    Button(action: { }) {
                        Text("Button")
                    }
                }
            }
        }
    }
}

If the button in the topBarTrailing is clicked first, the keyboard will show up in iOS 17, but not if the Textfield is clicked first.

Filed a feedback (FB13302279)

I am Also facing same issue @apple Team please look into this.

Judging by the various forums (here, stackoverflow, reddit etc), this seems to have been an issue for many months now. How is this not getting attention/fixed?

It works for me only in sheet presentation, and only first time (when I only open this screen, not another one before!). And if I hide my screen with toolbar in my app by menu presentation and open it again (here the screen is not hidden or closed). I think, view rebuilds itself again and all custom buttons in toolbar are visible. WTF with Apple Dev??

iOS 17 Toolbar Bugs
 
 
Q