Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created August 19, 2023 10:06
Show Gist options
  • Save laevandus/589f0e758a496848e5d7eeaad2929528 to your computer and use it in GitHub Desktop.
Save laevandus/589f0e758a496848e5d7eeaad2929528 to your computer and use it in GitHub Desktop.
struct BounceView: View {
@State private var value = 0
var body: some View {
VStack(spacing: 16) {
HStack {
Image(systemName: "snowflake")
.symbolEffect(.bounce, value: value)
Image(systemName: "snowflake")
.symbolEffect(.bounce, options: .speed(0.1), value: value)
Image(systemName: "snowflake")
.symbolEffect(.bounce, options: .repeat(2), value: value)
}
.imageScale(.large)
Button("Bounce") { value += 1 }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment