Post

Replies

Boosts

Views

Activity

Comment on How to change text in SwiftUI conditional button to systemImage?
.toolbar {             ToolbarItem(placement: .navigationBarTrailing) {                 Button(favorites.contains(item) ? systemImage: "heart" : systemImage: "heart.fill") {                     if favorites.contains(item) {                         favorites.remove(item)                     } else {                         favorites.add(item)                     }                 }             }         } This is the code that doesn't work
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’22
Comment on How to change text in SwiftUI conditional button to systemImage?
If I replace Button(favorites.contains(item) ? "-" : "+") in my original code with Button(favorites.contains(item) ? systemImage: "heart.fill": systemImage: "heart") it doesn't work anymore.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How to change text in SwiftUI conditional button to systemImage?
I'm sorry for the messy format above but if I modify the code in my original question to Button(favorites.contains(item) ? systemImage: "heart" : systemImage: "heart.fill") it doesn't work anymore
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on How to change text in SwiftUI conditional button to systemImage?
.toolbar {             ToolbarItem(placement: .navigationBarTrailing) {                 Button(favorites.contains(item) ? systemImage: "heart" : systemImage: "heart.fill") {                     if favorites.contains(item) {                         favorites.remove(item)                     } else {                         favorites.add(item)                     }                 }             }         } This is the code that doesn't work
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Comment on What is the bar in Apple Music called in SwiftUI to switch between "Apple Music" and "Your Library"?
Thanks a lot for this!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22