- Install
ConfettiView
- Add
ConfettiView
to your project
import SwiftUI
import ConfettiView
struct ContentView: View {
@State var showConfetti = false
var body: some View {
Button("Rain on me") {
showConfetti = true
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.overlay(ConfettiView(isPresented: $showConfetti))
}
}