Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created August 19, 2023 10:14
Show Gist options
  • Save laevandus/5d2cc8fa852979a49f99fe9fd6ad9179 to your computer and use it in GitHub Desktop.
Save laevandus/5d2cc8fa852979a49f99fe9fd6ad9179 to your computer and use it in GitHub Desktop.
struct ReplaceView: View {
@State private var isActive = false
var body: some View {
VStack(spacing: 16) {
HStack {
Image(systemName: isActive ? "pause.circle.fill" : "play.circle.fill")
.contentTransition(.symbolEffect(.replace))
Image(systemName: isActive ? "pause.circle.fill" : "play.circle.fill")
.contentTransition(.symbolEffect(.replace.offUp))
Image(systemName: isActive ? "pause.circle.fill" : "play.circle.fill")
.contentTransition(.symbolEffect(.replace.upUp))
}
.imageScale(.large)
Button("Replace") { isActive.toggle() }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment