Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created August 19, 2023 10:10
Show Gist options
  • Save laevandus/a63aa0588022c3e9e97b4d992a156f5d to your computer and use it in GitHub Desktop.
Save laevandus/a63aa0588022c3e9e97b4d992a156f5d to your computer and use it in GitHub Desktop.
struct PulseView: View {
@State private var isActive = false
var body: some View {
VStack(spacing: 16) {
HStack {
Image(systemName: "moonphase.first.quarter")
.symbolEffect(.pulse, isActive: isActive)
Image(systemName: "moonphase.first.quarter")
.symbolEffect(.pulse, options: .speed(0.1), isActive: isActive)
Image(systemName: "moonphase.first.quarter")
.symbolEffect(.pulse, options: .speed(5), isActive: isActive)
}
.imageScale(.large)
Button("Pulse") { isActive.toggle() }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment