toolbarForegroundStyle(_:for:) modifier not found in Xcode

Following up on my previous post about how to change the foreground tint color of tab bars in SwiftUI: https://developer.apple.com/forums/thread/760008

I have subsequently discovered the toolbarForegroundStyle(_:for:) modifier, documented here.

However, when I tried to use it in Xcode, it doesn't seem to be publicly declared, even though it should have been available since iOS 16 according to the doc.

Was this a mistake? I have filed feedback FB14553959.

Answered by Vision Pro Engineer in 798449022

Hi @NSCruiser ,

Thanks for calling this out. toolbarForegroundStyle is only available on watchOS 9.0+, this was inadvertently marked available on the other platforms. We'll get this corrected in the docs.

Accepted Answer

Hi @NSCruiser ,

Thanks for calling this out. toolbarForegroundStyle is only available on watchOS 9.0+, this was inadvertently marked available on the other platforms. We'll get this corrected in the docs.

@Vision Pro Engineer Thanks for clarifying. Regarding the original question - is there any other way to customize the tab bar's foreground tint color in SwiftUI, if this modifier is unavailable on iOS?

toolbarForegroundStyle(_:for:) modifier not found in Xcode
 
 
Q