I have the next TabView:
TabView(selection: self.$viewModel.selection) {
StoriesView()
.tabItem {
Label("Stories", systemImage: "play.square") // I need a yellow icon here
}
.tag("stories")
MessengerView()
.tabItem {
Label("Messenger", systemImage: "message") // I need a green icon here
}
.tag("messenger")
ProfileView()
.tabItem {
Label("Profile", systemImage: "person") // I need a red icon here
}
.tag("profile")
}
It works perfectly but I can't get how to set an own colour for every tab icon. I've tried all possible methods already foregroundColor(), accentColor(), tint() and so on... A nothing works. It changes a color of all tab icons or no one icon.
How to make it in TabView?
P.S. Maybe it's a noobie's question but I really got challenged.