Show the confetti only when the user is having fun, and if not having fun, don't show it.

Overview

SPConfetti

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

You can change shapes and switch between styles. It is possible to change the size and position of emitter. Ready use arc, star, heart triangle shapes. You can set custom shapes with your image.

If you like the project, don't forget to put star ★
Check out my other libraries:

Navigate

Installation

Ready for use on iOS & tvOS 12+. Works with Swift 5+. Required Xcode 12.0 and higher.

Swift Package Manager

The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

To integrate SPConfetti into your Xcode project using Xcode 12, specify it in File > Swift Packages > Add Package Dependency...:

https://github.com/ivanvorobei/SPConfetti

CocoaPods:

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate SPConfetti into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'SPConfetti'

Manually

If you prefer not to use any of dependency managers, you can integrate SPConfetti into your project manually. Put Sources/SPConfetti folder in your Xcode project. Make sure to enable Copy items if needed and Create groups.

Quick Start

For easy start confetti animation call this:

// For start animation
SPConfetti.startAnimating(.centerWidthToDown, particles: [.triangle, .arc])

// For stop animation
SPConfetti.stopAnimating()

If you want stop animation automatically in time, use it:

SPConfetti.startAnimating(.centerWidthToDown, particles: [.triangle, .arc], duration: 3)

You can manage by view SPConfettiView with custom layout if need.

Customise

Animation

For change emitter size and direction, use animation property. Now available next animations:

enum SPConfettiAnimation {

    case fullWidthToDown
    case fullWidthToUp
    case centerWidthToDown
    case centerWidthToUp
}

To change animation:

confettiView.animation = .centerWidthToDown

Particles

You can customise particles style and animation config.

// Available arc, star, heart, circle, triangle and polygon.
// You can set many styles particles.
confettiView.particles = [.star]

For set custom image use custom case:

confettiView.particles = [.custom(yourImage)]

Shared Configuration

You can set global values with configuration object. It will apply for all next configuration of confetti view by default.

// For example, available more
SPConfettiConfiguration.particles = [.star]
SPConfettiConfiguration.particlesConfig.colors = [.systemRed, .sytemBlue]

Delegate

For get notification about events, set delegate for view and implement protocol SPConfettiDelegate:

confettiView.delegate = self

Looks at protocol:

protocol SPConfettiDelegate: AnyObject {

    // Caling when animation start.
    func confettiDidStartAnimating()

    // Caling when animation stop.
    func confettiDidStopAnimating()

    // Caling when animation end. 
    // May calling after `confettiDidStopAnimating`,
    // becouse after stop emitting particles existing particles
    // still available.
    func confettiDidEndAnimating()
}

Other Projects

I love being helpful. Here I have provided a list of libraries that I keep up to date. For see video previews of libraries without install open opensource.ivanvorobei.by website.
I have libraries with native interface and managing permissions. Also available pack of useful extensions for boost your development process.

Russian Community

Веду каналы об iOS разработке. Один с туториалами и новостями, другой с обзором библиотек.
Со сложной задачей помогут в чате.

Видео-туториалы выклыдываю на YouTube:

Tutorials on YouTube

Comments
  • Displaying over Sheets

    Displaying over Sheets

    Describe the problem that you catch A clear and concise description of what you want to do. Hey, is it possible to display the confetti over a sheet? After the first start of the app and displaying the sheet, the confetti is getting displayed over it, after reopening the sheet, it's getting displayed behind it. It's kinda problematic to share a video with you, because I have to blur out all personal data, but If you really need it, I can do it. I would be glad if you could help :) Thanks!

    opened by blockiyt 8
  • Add SwiftUI Support

    Add SwiftUI Support

    Goal

    • Add SwiftUI Support (iOS)
    • Add SwiftUI Example (iOS)

    Checklist

    • [x] Testing in iOS
    • [x] Installed correct via Swift Package Manager
    • [ ] Installed correct via Cocoapods
    opened by gongzhang 3
  • iOS 15.5 Bug: Confetti does not appear

    iOS 15.5 Bug: Confetti does not appear

    Details

    • iOS 15.5
    • SPConfetti 1.4.0
    • Installed via Cocoapods

    Describe the Bug Confetti does not appear on devices with iOS 15.5. The startAnimating call is simply ignored without errors.

    bug 
    opened by Rogue85 2
  • SPM: Couldn’t check out revision

    SPM: Couldn’t check out revision "fd172fe3cc07572e546942cb175b16e549fc3e1a"

    Details

    • Xcode 13.4
    • Framework Version 1.4
    • Installed via SPM

    Describe the Bug

    Hi Ivan,

    I have encountered a strange problem. When I add Package Dependencies in Xcode's Project Setting, the SPM seems to resolve the latest SPConfetti to an incorrect revision. I use the Xcode default settings when adding dependency.

    image

    However, the revision in the Package.resolved file points to fd172fe3cc07572e546942cb175b16e549fc3e1a, but this commit seems to be incorrect. There is also a warning on GitHub page for this revision: fd172fe3cc07572e546942cb175b16e549fc3e1a.

    // Package.resolved
          {
            "package": "SPConfetti",
            "repositoryURL": "https://github.com/ivanvorobei/SPConfetti.git",
            "state": {
              "branch": null,
              "revision": "fd172fe3cc07572e546942cb175b16e549fc3e1a", // <=== 🤔
              "version": "1.4.0"
            }
          },
    

    This issue can cause SPM to fail to checkout dependencies when building with CI. I can mannually edit Package.resolve to workaround the issue. But it will be great to fix it from the repo.

    bug 
    opened by gongzhang 2
  • Failed to archive build with latest SwiftUI code

    Failed to archive build with latest SwiftUI code

    Describe the bug Hi, Ivan, I just noticed the latest SwiftUI code break the SPM build. (-。-;

    To Reproduce

    1. In Xcode, select the "iOS SwiftUI Example" target and build for "Any iOS Device"
    2. Product menu > run Archive
    3. The compiler will report errors related to SwiftUI symbols.

    image

    bug 
    opened by gongzhang 2
  • Maybe apply 3D transforms to particles to achieve better effects?

    Maybe apply 3D transforms to particles to achieve better effects?

    Is your feature request related to a problem? Please describe. I really like the confetti effect in iMessage. It would be nice if SPConfetti could do something similar.

    Describe the solution you'd like 👍 Checkout this repo: bryce-co/RecreatingiMessageConfetti

    Describe alternatives you've considered n/a

    Additional context n/a

    enhancement 
    opened by gongzhang 2
  • Colors are wrong

    Colors are wrong

    Hi, When I choose colors, the result is not good, all displaying colors cells are more dark, than the original color chosen. For example a yellow this one, FCB700, become totally orange in cells.

    wait more 
    opened by ljs19923 1
  • required a higher minimum deployment target

    required a higher minimum deployment target

    Xcode 12.5.1 pod 1.10.1 swift 5 development version 11 or 12 platform :ios, '12.1'

    pod install
    Analyzing dependencies
    [!] CocoaPods could not find compatible versions for pod "SPConfetti":
      In Podfile:
        SPConfetti
    
    Specs satisfying the `SPConfetti` dependency were found, but they required a higher minimum deployment target.
    
    opened by dd9913762113 0
Releases(1.4.1)
Owner
Ivan Vorobei
iOS Developer
Ivan Vorobei
Identify Intel-Only Apps on your Mac with ease:

Silicon About Identify Intel-Only Apps on your Mac with ease: License Project is released under the terms of the MIT License. Repository Infos Owner:

DigiDNA 650 Jan 2, 2023
NetworkLight - Ventura only networkquality monitor

NetworkLight NetworkLight is a small menubar wrapper for networkquality to requlary check the network capacity. The data is saved and can be exported

Holger Krupp 9 Nov 23, 2022
Pendo captures product usage data, gathers user feedback, and lets you communicate in-app to onboard, educate, and guide users to value

Pendo SDK for IOS The Pendo Mobile SDK is a code-less, retro-active analytics collector across all of your app's versions. The SDK also allows present

Pendo 30 Jan 4, 2023
The app allows the user to change text color and text content when the displayed button is clicked

Hello World! App Description This application allows the user to change text color and text content when the displayed button is clicked. App Walk-tho

null 0 Mar 15, 2022
A common use case is wanting to convert device identifiers such as iPhone10,1 to a user friendly name; iPhone 8.

Devices Swift package that contains all devices from https://www.theiphonewiki.com/wiki/Models. A common use case is wanting to convert device identif

null 17 Nov 28, 2022
This is a basic mobile app that allows the user to tap a button to change the color of a label.

MYAPP App Description `This is a basic mobile app that allows the user to tap a button to change the color of a label. App Walk-though Required User S

null 0 Nov 27, 2021
Generate Swift code from Qt5 user interfaces.

Qlift-uic Description qlift-uic takes a Qt5 user interface description file and compiles it to Swift code for use with QLift. Splitted from main QLift

Dmitriy Borovikov 1 Apr 2, 2022
A usermanager written in swift 3.0 saves you from hassle of saving your active user session.

SwiftUserManager A usermanager written in swift 3.0 saves you from hassle of saving your active user session. Call api and give the json to MOProfile

Zeeshan Haider 22 Sep 30, 2022
Monkey is an unofficial GitHub client for iOS,to show the rank of coders and repositories.

Monkey for GitHub 中文README Monkey is an unofficial GitHub client. Monkey for GitHub is my first App,open source project.Welcome to download. GitHub op

coderyi 1.8k Jan 6, 2023
Mybook swiftui - A Facebook UI Clone with some capabilities like like/unlike, comment, scroll, show stories etc

mybook_swiftui ?? Trying to create a Facebook UI Clone with some capabilities li

mogolAyberk 1 Apr 16, 2022
Dicee-SwiftUI - This app show random dicee every time the you make click in button roll

Dicee-SwiftUI This app show random dicee every time the you make click in button

Adriancys Jesus Villegas Toro 0 Feb 4, 2022
React Native utility library around image and video files for getting metadata like MIME type, timestamp, duration, and dimensions. Works on iOS and Android using Java and Obj-C, instead of Node 🚀.

Qeepsake React Native File Utils Extracts information from image and video files including MIME type, duration (video), dimensions, and timestamp. The

Qeepsake 12 Oct 19, 2022
LinkedLog is a Xcode plugin that includes a Xcode PCH header file template that adds the macros `LLog` and `LLogF` and parses their output to link from the console to the corresponding file and line.

LinkedLog Xcode Plugin LinkedLog is a Xcode plugin that includes a Xcode PCH file template that adds the macros LLog and LLogF. The LLog macro will wo

Julian F. Weinert 22 Nov 14, 2022
BioViewer - Protein (.pdb, .cif and .fasta) viewer for iPhone, iPad and Mac, using SwiftUI + SceneKit

BioViewer - Protein (.pdb, .cif and .fasta) viewer for iPhone, iPad and Mac, using SwiftUI + SceneKit

Raúl Montón 16 Dec 21, 2022
Custom MacBook login screen and pam modules using multipeer connectivity and usb hardware checks with iOS app for sign in.

Custom MacBook login screen and pam modules using multipeer connectivity and usb hardware checks with iOS app for sign in.

null 2 Aug 17, 2022
A simple, reliable and scalable delivery API for transactional push notifications for websites and applications

Catapush is a simple, reliable and scalable delivery API for transactional push notifications for websites and applications. Ideal for sending data-dr

Catapush 0 Dec 29, 2021
Kotlin Multiplatform sample with SwiftUI and Compose (Desktop and Android) clients. Heavily inspired by Wordle game.

WordMasterKMP Kotlin Multiplatform sample heavily inspired by Wordle game and also Word Master and wordle-solver samples. The main game logic/state is

John O'Reilly 56 Oct 4, 2022
Joplin - an open source note taking and to-do application with synchronization capabilities for Windows, macOS, Linux, Android and iOS. Forum: https://discourse.joplinapp.org/

Joplin® is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are sea

Laurent 33.7k Dec 30, 2022
KnockToReact is an iOS library written in Swift and Objective-C that brings an exclusive feature to interact with users just by receiving and recognizing "knocks" in the device.

KnockToReact is an iOS library written in Swift and Objective-C that brings an exclusive feature to interact with users just by receiving and recognizing "knocks" in the device.

Matheus Cavalca 25 Feb 10, 2022