gh-EmergeTools-Pow/Example/Pow Example/Examples/Change Effects/JumpExample.swift
Joe Fabisevich 5b95fe95b0
Moving Pow to @emergetools (#36)
Co-authored-by: Robert Böhnke <robb@robb.is>
Co-authored-by: Kasper Lahti <kasper@lahti.email>
2023-11-29 12:08:53 -03:00

32 lines
683 B
Swift

import Pow
import SwiftUI
struct JumpExample: View, Example {
@State
var changes: Int = 0
var body: some View {
ZStack {
PlaceholderView()
.changeEffect(.jump(height: 40), value: changes)
}
.defaultBackground()
.onTapGesture {
changes += 1
}
}
static var description: some View {
Text("""
Makes the view jump the given height and then bounces a few times before settling.
- `height`: The height of the jump.
""")
}
static let localPath = LocalPath()
static var icon: Image? {
Image(systemName: "figure.jumprope")
}
}