I have a TabView with labels, I am not sure why this isn't documented at all and I've found on another question on the stackoverflow that the following lines of code only works on iOS 15.0:
if (selectedTab == 2) {
Label("Playlist", systemImage: "star.fill")
} else {
Label("Playlist", systemImage: "star")
.environment(\.symbolVariants, .none)
}
This works as desired when my project has 15.0 as the minimum version, however, anything below marks the following error:
Key path value type 'WritableKeyPath<EnvironmentValues, SymbolVariants>' cannot be converted to contextual type 'KeyPath<EnvironmentValues, SymbolVariants>
How do I make earlier versions show unfilled icons (outline/default/none) in a TabView ?