DEV Community

Liang Wang
Liang Wang

Posted on

isFavorite

.toolbar {
          ToolbarItem {
            Button {
              isFavorite.toggle()
            } label: {
              Label("Favorite", systemImage: isFavorite ? "heart.fill" : "heart")
            }

          }
        }
Enter fullscreen mode Exit fullscreen mode

Top comments (0)