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
Oct ’22