LoginSignup
1
4

【SwiftUI】.contentTransition(.symbolEffect(.replace)) だけで元気が出る件

Last updated at Posted at 2024-05-09

結構、イメージが変わる。

Button {
  value.toggle()
} label: {
  Label("Favorite", systemImage: "heart")
    .symbolVariant(value ? .fill : .none)
    .contentTransition(.symbolEffect(.replace)) // *
}

sc 2024-05-09 at 16.05.46.gif

便利です。

🤔 参考

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4