-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to start and stop the effects programmatically #4
Comments
I was looking to pass a |
That's one approach for sure @Dave181295! So, what you always can do, is to have a @State private var showingEffect = true
/// ...
if showingEffect {
ConfettiView()
}
/// ...
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
withAnimation {
showingEffect = false
}
}
} But that would just be a workaround for now, we'll find a better way and expose that in one of the upcoming versions! If you have wishes for the functionality, feel free to add them here! :) |
Having the option to manually start and end the effects allows for more use-cases.
Right now, this is only possible by manipulating the
alpha
of the effects which is not ideal in terms of both user- and developer-experience.The idea is to have a
.start()
and.stop()
functionality for all effects. Although different implementations would be necessary for theSpriteKit
andCAEmitterLayer
based effects, the API has to be the same for making it a streamlined effort for developers to integrate.The text was updated successfully, but these errors were encountered: