Confetti! Who doesn't like confetti?

Overview

SAConfettiView

language CI Status Version License Platform

confetti

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 Swift, 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

SAConfettiView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SAConfettiView"

And then run:

$ pod install

Manual Installation

To manually install SAConfettiView, simply add SAConfettiView.swift to your project.

Usage

Creating a SAConfettiView is the same as creating a UIView:

let confettiView = SAConfettiView(frame: self.view.bounds)

Don't forget to add the subview!

self.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 = .Confetti
.Triangle

triangle

confettiView.type = .Triangle
.Star

star

confettiView.type = .Star
.Diamond

diamond

confettiView.type = .Diamond
.Image

image

confettiView.type = .Image(UIImage(named: "smiley"))

Colors

Set the colors of the confetti with the .colors property. This property has a default value of multiple colors.

confettiView.colors = [UIColor.redColor(), UIColor.greenColor(), UIColor.blueColor()]

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()

Status

To check if the confetti is active and currently being displayed, use

confettiView.isActive()

Returns true if it is being displayed, and false if it is not.

Change Log

1.0.8

  • Add isActive() method to determine if the confetti is currently active Shakarang #9

1.0.7

  • Use view's width property instead of center to fix bug in UIScrollView debug29 #4

1.0.6

  • Prevent error when calling .stopConfetti() before .startConfetti() ahmads #7

1.0.5

1.0.4

  • Replace .Custom with .Image(UIImage) for easier customization of confetti image gmertk #2

License

Copyright (c) 2015 Sudeep Agarwal

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Symbol(s) not found for architecture i386

    Symbol(s) not found for architecture i386

    Getting this error on iPhone 5 & 4S; non-64 bit devices. Using Cocoapods.

    Undefined symbols for architecture i386:
      "SAConfettiView.SAConfettiView.__allocating_init (SAConfettiView.SAConfettiView.Type)(frame : __C.CGRect) -> SAConfettiView.SAConfettiView", referenced from:
          AppName.FirstViewController.(functionName (AppName.FirstViewController) -> (Swift.Int, showBigIndicator : Swift.Bool) -> ()).(closure #1).(closure #1) in FirstViewController.o
      "type metadata accessor for SAConfettiView.SAConfettiView", referenced from:
          AppName.FirstViewController.(functionName (AppName.FirstViewController) -> (Swift.Int, showBigIndicator : Swift.Bool) -> ()).(closure #1).(closure #1) in FirstViewController.o
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    opened by jamesallison 2
  • Upgrading cocoapods and migrate to swift 4.2

    Upgrading cocoapods and migrate to swift 4.2

    changing constants that can not be used when upgrading to swift 4.2 Migrate to swift 4.2

    pod lib lint SAConfettiView.podspec Runtime result

    ->> pod lib lint SAConfettiView.podspec 
    
     -> SAConfettiView (0.1.9)
        - NOTE  | xcodebuild:  note: Using new build system
        - NOTE  | [iOS] xcodebuild:  note: Planning build
        - NOTE  | [iOS] xcodebuild:  note: Constructing build description
        - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')
    

    When this PR is merged,

    You should upgrade to cocoapods.

    best regards

    close #54

    opened by keisukeYamagishi 1
  • Added current state

    Added current state

    Hello !

    This pull request is to get the currentState of SAConfettiView, if it is Running or not.

    You have a var called currentState which is read-only mode for user and an other which is private so only confetti view access it !

    Bye !

    opened by Shakarang 1
  • Use the view width instead of x position

    Use the view width instead of x position

    Maybe better to use the view width instead of the view x position for the emitter position.

    Because with the x position there is a bug when the confettiView is add in a scrollview.

    opened by debug29 1
  • Updated the birthRate to be more random

    Updated the birthRate to be more random

    If you watch, the confetti comes in waves/batches. If you make it slightly more random on each color, they come continuously instead and it looks smoother.

    opened by gordontucker 0
Owner
Sudeep Agarwal
I build things.
Sudeep Agarwal
SwiftUI Package for Configurable Confetti Animation πŸŽ‰

?? ConfettiSwiftUI ?? Swift package for displaying configurable confetti animation. Find the demo project here. Installation: It requires iOS 14 and X

Simon Bachmann 737 Jan 8, 2023
The Effects Library allows developers to create sophisticated and realistic particle systems such as snow, fire, rain, confetti, fireworks, and smoke with no or minimal effort.

The Effects Library allows developers to create sophisticated and realistic particle systems such as snow, fire, rain, confetti, fireworks, and smoke with no or minimal effort.

Stream 182 Jan 6, 2023
🎨 Gradient animation effect like Instagram

Pastel ?? Gradient animation effect like Instagram Example override func viewDidLoad() { super.viewDidLoad() let pastelView = PastelView(fram

Cruz 3.4k Jan 1, 2023
Poi - You can use tinder UI like tableview method

Poi You can use tinder UI like tableview method Installation Manual Installation Use this command git clone [email protected]:HideakiTouhara/Poi.git Imp

null 65 Nov 7, 2022
Bring life to CALayers with SpriteKit-like animation builders

Animo Bring life to CALayers with SpriteKit-like animation builders. Why use Animo? Because declaring CAAnimations (especially with CAAnimationGroups)

エウレカ 279 Dec 9, 2022
FloatingBubbles is a customizable views that float like zero gravity animation.

Floating Bubbles FloatingBubbles is a customizable views that float like zero gravity animation. $ pod try FloatingBubbles Features Create Multiple V

Chandan Sharda 18 Oct 11, 2022
An animated trophy banner that looks like Xbox achievement πŸ†

TrophyKit An animated trophy banner that looks like Xbox achievement. Demo demo.mov Usage Requirements iOS 14.0+ tvOS 14.0+ Swift 5.3+ Installation Tr

Yubo Qin 11 Jul 18, 2022
An experiment for using SwiftUI's custom timing Animation to create an orbital-like animation.

Orbital-SwiftUI-Animation An experiment for using SwiftUI's custom timing curve to create an orbital-like animation. How it looks: How it works: Apply

Mostafa Abdellateef 7 Jan 2, 2023
Cool wave like transition between two or more UICollectionView

CKWaveCollectionViewTransition This is a cool custom transition between two or more UICollectionViewControllers with wave-like cell animation. Could b

Cezary Kopacz 1.9k Oct 4, 2022
Fluid - Use a declarative syntax to build your user interface using UIKit like SwiftUI

Fluid Fluid is powered by ResultBuilder and a custom layout engine. You can uses

HZ.Liu 13 Dec 9, 2022
SAHistoryNavigationViewController realizes iOS task manager like UI in UINavigationContoller. Support 3D Touch!

SAHistoryNavigationViewController realizes iOS task manager like UI in UINavigationContoller. Support 3D Touch!

Taiki Suzuki 1.6k Dec 29, 2022
Tinder/Bumble like user image with user details scroll animation

TinderUserProfile Tinder/Bumble like user image with user details scroll animation Add ProfileView.m,ProfileView.h class to your project. Set the clas

Souvick Ghosh 21 Jun 21, 2022
Snapchat-like filters, AR lenses, and real-time facial animations.

react-native-deepar Snapchat-like filters, AR lenses, and real-time facial animations. React-Native wrapper for DeepAR. Table of Contents What is Deep

RΔ±dvan Altun 82 Dec 13, 2022
Animated alert library like Swarm app.

TKSwarmAlert Animation Tool for Alert like Swarm app. ScreenShot Installation CocoaPods You can use CocoaPods to install TKSwarmAlert by adding it to

Takuya Okamoto 581 Dec 2, 2022
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

Or Ron 234 Nov 22, 2022
SwiftUI project demonstrating Custom coded confetti animation for checkout page

Confetti-Checkout SwiftUI project demonstrating Custom coded confetti animation for checkout page NOTE: CAEmitterLayer is not used but all the confett

Waseem akram 29 Sep 28, 2022
ConfettiKit is a custom framework used to add Confetti on your iOS/iPadOS projects.

ConfettiKit is a custom framework used to add Confetti on your iOS/iPadOS projects. The kit provides variety of customisations inorder to design a confetti which matches your project's UI. ConfettiKit makes your work of adding Confetti on your project with just one line of code.

Gokul Nair 14 Sep 27, 2022
Show the confetti only when the user is having fun, and if not having fun, don't show it.

SPConfetti - A simple solution to show the confetti to the user. Smoothly starts and stops. Allow set multiply diffrent particles at once. You can chang

Ivan Vorobei 225 Dec 30, 2022
SwiftUI Package for Configurable Confetti Animation πŸŽ‰

?? ConfettiSwiftUI ?? Swift package for displaying configurable confetti animation. Find the demo project here. Installation: It requires iOS 14 and X

Simon Bachmann 737 Jan 8, 2023
A simple confetti view for apps using SwiftUI.

ConfettiView Create fun animated confetti views with ease! Installation Use Swift Package Manager to install this package: https://github.com/benlmyer

Ben Myers 8 Dec 15, 2022