gh-EmergeTools-Pow/Example/Pow Example/Examples/Transitions/IrisExample.swift
Joe Fabisevich 781d455727
Moving Pow to @emergetools
Co-authored-by: Robert Böhnke <robb@robb.is>
Co-authored-by: Kasper Lahti <kasper@lahti.email>
2023-11-29 09:38:34 -05:00

30 lines
712 B
Swift

import Pow
import SwiftUI
struct IrisExample: View, Example {
@State
var isVisible: Bool = false
var body: some View {
ZStack {
if isVisible {
PlaceholderView()
.compositingGroup()
.transition(.movingParts.iris(blurRadius: 10))
}
}
.defaultBackground()
.onTapGesture {
withAnimation(.spring(dampingFraction: 1)) {
isVisible.toggle()
}
}
.autotoggle($isVisible, with: .spring(dampingFraction: 1))
}
static let localPath = LocalPath()
static var icon: Image? {
Image(systemName: "camera.aperture")
}
}