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>
37 lines
813 B
Swift
37 lines
813 B
Swift
import Pow
|
|
import SwiftUI
|
|
|
|
struct SwooshExample: View, Example {
|
|
@State
|
|
var isVisible: Bool = false
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
if isVisible {
|
|
PlaceholderView()
|
|
.transition(.movingParts.swoosh.combined(with: .opacity))
|
|
}
|
|
}
|
|
.defaultBackground()
|
|
.onTapGesture {
|
|
let animation: Animation
|
|
|
|
if isVisible {
|
|
animation = .easeIn
|
|
} else {
|
|
animation = .spring()
|
|
}
|
|
|
|
withAnimation(animation) {
|
|
isVisible.toggle()
|
|
}
|
|
}
|
|
.autotoggle($isVisible, with: .spring())
|
|
}
|
|
|
|
static let localPath = LocalPath()
|
|
|
|
static var icon: Image? {
|
|
Image(systemName: "skew")
|
|
}
|
|
}
|