Skip to content

ziligy/ConfettiView

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

ConfettiView

A SwiftUI View that emits confetti with user-defined shapes, images, and text.

SwiftUI ConfettiView by ziligy

Installation

ConfettiView is available through Swift Package Manager

  • In Xcode choose File -> Swift Packages -> Add Package Dependency...
  • Paste this Github URL (https://github.com/ziligy/ConfettiView ) into the search bar and click Next.
  • When repository displays, click Next.
  • When loaded, click Finish.

Simple Use

import SwiftUI
import ConfettiView

struct ContentView: View {

    let confettiView = ConfettiView( confetti: [
                .text("πŸŽ‰"),
                .text("πŸ’ͺ"),
                .shape(.circle),
                .shape(.triangle),
            ])

    var body: some View {
        confettiView
    }
}

Example

see included example for:

  • timed-celebration
  • fade out
  • including images

Apps Using ConfettiView

Attributions

inspiration and code influences