Xamarin ConfettiView
Port of SAConfettiView to Xamarin.Ios
It's raining confetti! SAConfettiView is the easiest way to add fun, multi-colored confetti to your application and make users feel rewarded. Written in csharp, SAConfettiView is a subclass of UIView and is highly customizable. From various types and colors of confetti to different levels of intensity, you can make the confetti as fancy as you want.
Installation
Available from Nuget
Usage
Creating a SAConfettiView is the same as creating a UIView:
ConfettiView = new ConfettiView(View.Bounds);
Don't forget to add the subview!
View.AddSubview(ConfettiView);
Types
Pick one of the preconfigured types of confetti with the type
property, or create your own by providing a custom image. This property defaults to the Confetti
type.
Confetti
confettiView.type = ConfettiType.Confetti;
.Triangle
confettiView.type = ConfettiType.Triangle;
.Star
confettiView.type = ConfettiType.Star;
.Diamond
confettiView.type = ConfettiType.Diamond;
.Image
Intensity
The intensity refers to how many particles are generated and how quickly they fall. Set the intensity of the confetti with the .intensity
property by passing in a value between 0 and 1. The default intensity is 0.5.
confettiView.Intensity = 0.75;
Starting
To start the confetti, use
confettiView.StartConfetti();
Stopping
To stop the confetti, use
confettiView.stopConfetti();
License
MIT