/Xamarin.Ios.ConfettiView

Port of SAConfettiView to Xamarin.Ios

Primary LanguageC#Apache License 2.0Apache-2.0

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

confetti

confettiView.type = ConfettiType.Confetti;
.Triangle

triangle

confettiView.type = ConfettiType.Triangle;
.Star

star

confettiView.type = ConfettiType.Star;
.Diamond

diamond

confettiView.type = ConfettiType.Diamond;
.Image

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