mirror of
https://github.com/EmergeTools/Pow.git
synced 2026-03-25 08:55:50 +00:00
Co-authored-by: Robert Böhnke <robb@robb.is> Co-authored-by: Kasper Lahti <kasper@lahti.email>
32 lines
683 B
Swift
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")
|
|
}
|
|
}
|