Confetti View lets you create a magnificent confetti view in your app

Related tags

UI ConfettiView
Overview

Version License Swift 3.0 Platform

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 Swift 3 :)

It reacts to the phone accelerometer therefore it's better to run the example project on the device.

Usage

With Interface Builder

Simply pick a view and change it's type to ConfettiView.

Programaticlly

ConfettiView is a subclass of UIView

let confettiView = ConffetiView()
self.view.addSubView(confettiView)

Controls

Start or stop the animation:

confettiView.stopAnimating()
confettiView.startAnimating()

Check whether the animation is active:

confettiView.isAnimating

By default the animation starts when the view is initialized

Installation

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

pod "ConfettiView"

Author

Or Ron, [email protected]

@or_ron

License

ConfettiView is available under the MIT license. See the LICENSE file for more info.

You might also like...
An iOS picker view to serve all your
An iOS picker view to serve all your "picking" needs

Mandoline The PickerView is a UICollectionView that provides a smooth "picking" interface. In order to get the most out of it, a consuming view contro

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles
A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles

A drop-in universal library helps you to manage the navigation bar styles and makes transition animations smooth between different navigation bar styles while pushing or popping a view controller for all orientations. And you don't need to write any line of code for it, it all happens automatically.

You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.
You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.

PullToDismiss PullToDismiss provides dismiss modal viewcontroller function like Facebook Messenger by pulling scrollview or navigationbar with smooth

Reel Search is a Swift UI controller that allows you to choose options from a list
Reel Search is a Swift UI controller that allows you to choose options from a list

REEL SEARCH Reel Search is a Swift UI controller that allows you to choose options from a list We specialize in the designing and coding of custom UI

A framework which helps you attach observers to `UIView`s to get updates on its frame changes

FrameObserver is a framework that lets you attach observers to any UIView subclass and get notified when its size changes. It doesn't use any Method S

A custom UIControl which functions like UISlider where you can set multiple intervals with different step values for each interval.
A custom UIControl which functions like UISlider where you can set multiple intervals with different step values for each interval.

MultiStepSlider A custom UIControl which functions like UISlider where you can set multiple intervals with different step values for each interval. Th

A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Circular progress indicator for your macOS app
Circular progress indicator for your macOS app

CircularProgress Circular progress indicator for your macOS app This package is used in production by apps like Gifski and HEIC Converter. Requirement

Show progress in your app's Dock icon
Show progress in your app's Dock icon

DockProgress Show progress in your app's Dock icon This package is used in production by the Gifski app. You might also like some of my other apps. Re

Comments
  • How to setup only work in Y axis.

    How to setup only work in Y axis.

    I checked the awesome source code you written, it based on CMMotionManager. I applied the motion confettiView in my project, the entire effect looks good, but how can I stop the X and Z directions, just only work in Y axis.

    Thanks in advance.

    Feature 
    opened by allenwong 2
  • Ipad width breaks one aspect.

    Ipad width breaks one aspect.

    Hey, just tried using it in my app and made a small change to: https://github.com/OrRon/ConfettiView/blob/master/ConfettiView/Classes/ConfettiLayer.swift#L128

    Instead of 380 I used self.view.frame.size.width and then it works on iPad as well as iphones and doesn't necessarily use 380 on older devices which are only 320. I'd make a new branch and ask for a PR but honestly this is a very small change and you might not want to do it. But it was just a suggestion!

    opened by ryleyherrington 2
  • Carthage Support

    Carthage Support

    I would like to add support for Carthage integration. Things that would need to be changed:

    • Xcode project made that targets a dynamic framework.
    • We could leave existing project directory/structure alone.
    • Instruction changes to the readme.
    opened by BandoKal 1
  • Possibility to add images instead of shapes?

    Possibility to add images instead of shapes?

    Hi there,

    Great pod! I'm looking for a way to provide my own images. What I've done right now is this:

    ImageView.swift

    import UIKit
    
    class ImageView: UIView {
    	var possibleColors:[UIColor] = [#colorLiteral(red: 0, green: 0.4443781972, blue: 0.8679092526, alpha: 1),#colorLiteral(red: 0.5667363405, green: 0.8658216596, blue: 0.4901404977, alpha: 1),#colorLiteral(red: 1, green: 0.9203848839, blue: 0.331726253, alpha: 1),#colorLiteral(red: 0.9978461862, green: 0.3002898395, blue: 0.2846045196, alpha: 1),#colorLiteral(red: 0.7954284549, green: 0.3837707639, blue: 0.7679683566, alpha: 1)]
    	
    	override init(frame: CGRect) {
    		super.init(frame: frame)
    		
    		self.backgroundColor = UIColor.clear
    		
    	}
    	required init?(coder aDecoder: NSCoder) {
    		fatalError("init(coder:) has not been implemented")
    	}
    	
    	/**
    	Initialize a new shape view with random shape and color
    	
    	- Parameters:
    	- center: The center position of the initiaized view
    	- depth: The wanted depth, this causes the shape to move faster and apear smaller to create the illusion of depth *Default Value is 1*
    	*/
    	convenience init(center point:CGPoint, depth:Double = 1, image: UIImage) {
    		self.init(frame:CGRect(x: 0, y: 0, width: 20/depth, height: 20/depth))
    		self.center = point
    		
    		let index: Int = Int(arc4random_uniform(UInt32(self.possibleColors.count)))
    		let color: UIColor = self.possibleColors[index]
    		
    		let imageView = UIImageView(image: image.withRenderingMode(.alwaysTemplate))
    		imageView.tintColor = color
    		imageView.frame = self.frame
    		self.addSubview(imageView)
    	}
    }
    

    It works kind of okay, but some images are spinning pretty weird. And some images are appearing suddenly in the view.

    Can we find a way to improve this, so this pod can be even more awesome 👍 ?

    Thanks!

    Feature 
    opened by wouterwisselink 1
Owner
Or Ron
Engineering Manager at @Facebook
Or Ron
DrawerKit lets an UIViewController modally present another UIViewController in a manner similar to the way Apple's Maps app works.

DrawerKit What is DrawerKit? DrawerKit is a custom view controller presentation mimicking the kind of behaviour in the Apple Maps app. It lets any vie

Babylon Health 773 Dec 27, 2022
NotSwiftUI is designed to help you create UI components quickly and efficiently with code!

NotSwiftUI NotSwiftUI is designed to help you create UI components quickly and efficiently with code! Capitalizing on the idea that most of the UI ele

Jonathan G. 50 Dec 20, 2022
Easily use UIKit views in your SwiftUI applications. Create Xcode Previews for UIView elements

SwiftUIKitView Easily use UIKit views in SwiftUI. Convert UIView to SwiftUI View Create Xcode Previews from UIView elements SwiftUI functional updatin

Antoine van der Lee 682 Dec 29, 2022
Create view hierarchies declaratively.

Create view hierarchies declaratively. Quick Look view.pd.add( imageView.pd.image(logoImage), label.pd.text("Logo").textColor(.red).font(size:

Javier Zhang 69 Oct 19, 2022
Create SwiftUI Views with any data

Create SwiftUI Views with any data

Zach Eriksen 20 Jun 27, 2022
Create macOS apps with Swift packages instead of Xcode projects

Swift Bundler A Swift Package Manager wrapper that allows the creation of MacOS apps with Swift packages instead of Xcode projects. My motivation is t

null 182 Dec 25, 2022
Create descriptive UIKit screens, faster!

Columbina's DeclarativeUIKit Create descriptive UIKit screens, faster! Get rid of constraints manipulation and use declarative language to create your

Columbina 2 Dec 12, 2021
A UIControl subclass that makes it easy to create empty states.

AZEmptyState Making empty state simple. Screenshots Installation Cocoa Pods: pod 'AZEmptyState' Manual: Simply drag and drop the Sources folder to you

Antonio Zaitoun 88 Oct 2, 2022
A child view controller framework that makes setting up your parent controllers as easy as pie.

Description Family is a child view controller framework that makes setting up your parent controllers as easy as pie. With a simple yet powerful publi

Christoffer Winterkvist 246 Dec 28, 2022