Coder Social home page Coder Social logo

easyconfetti's Introduction

EasyConfetti

Buy Me A Coffee

โค๏ธ Support my apps โค๏ธ

โค๏ธโค๏ธ๐Ÿ˜‡๐Ÿ˜๐Ÿค˜โค๏ธโค๏ธ

Usage

Basic

// Create the view
let confettiView = ConfettiView()
view.addSubview(confettiView)

// Configure
confettiView.config.particle = .confetti(allowedShapes: Particle.ConfettiShape.all)

// Start
confettiView.start()

// Stop
confettiView.stop()

Configuration

Configuration will be applied at the next start

// Use predefined confetti
confettiView.config.particle = .confetti(allowedShapes: Particle.ConfettiShape.all)

// Use texts
let string = NSAttributedString(string: "โค๏ธ", attributes: [
  NSFontAttributeName: UIFont.systemFont(ofSize: 15)
])
confettiView.config.particle = .text([string])

// Use images
let image = UIImage(named: "star")
confettiView.config.particle = .image([image])

// Change colors
confettiView.config.colors = [UIColor.red, UIColor.green]

// Customize cells
confettiView.config.customize = { cells in

}

Installation

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

pod 'EasyConfetti'

EasyConfetti is also available through Carthage. To install just write into your Cartfile:

github "hyperoslo/EasyConfetti"

EasyConfetti is also available through Accio. To install just write into your Package.swift:

.package(url: "https://github.com/onmyway133/EasyConfetti.git", .upToNextMajor(from: "2.3.0")),

Then link EasyConfetti in your App target like so:

.target(
    name: "App",
    dependencies: [
        "EasyConfetti",
    ]
),

EasyConfetti can also be installed manually. Just download and drop Sources folders in your project.

Author

Credit

Contributing

We would love you to contribute to EasyConfetti, check the CONTRIBUTING file for more info.

License

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

easyconfetti's People

Contributors

anderscarling avatar boyvanamstel avatar damirstuhec avatar fredpi avatar jbuckner avatar jeehut avatar onmyway133 avatar revolter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easyconfetti's Issues

Does not always work

For my use case, I want to add this effect to a view controller just after it has been pushed to a navigation stack. Strangely, sometimes when the VC is pushed, the confetti effect is not shown at all.

I created an example project that demonstrates the issue. To see it in action:

  1. Clone or download the project
  2. pod install
  3. Run the project in Xcode

The example app has a 'continue' button in the centre of the screen. Tapping it will navigate to a new screen with the confetti effect enabled. After going back and forth between the two screens a few times, the effect will randomly fail to display.

Confetti falling down from top left of view

Hi,
Not sure if I'm doing anything wrong but I add the view and use auto layout to constrain it to the edges of my superview but for some reason the confetti is not sprinkled from the top of the view (like illustrated in the readme) but from the top left corner. Why is that?

Make the latest code available in a release

Hi,

Sorry if I missed something, but it appears that the release 2.0.0 doesn't contain the latest code updates that were merged in the latest PRs.
For example, I couldn't find the code changes from PR #9.

Any chance you can publish a new version with the latest code?
Thanks!

Suggestion

If somebody uses the .image you shouldn't assume that they want the particles to be generated with color - ruins the effect.

Just a heads up - thanks for the code :)

Emitting from the top left of programmatic super view

Hi, I used the library to have confetti start from the top across the entire width of the screen like shown in the README animation. However, my usage was slightly different. In place of adding the confetti on the ViewController's view, I added to a different view that is rendered on top of the ViewController. Think an alert controller's background. Since my new view was created programmatically, the bounds were 0,0,0,0. A better way to make it work for all superviews that may or may not be rendered before the view is added to the subview.
I have already fixed it for myself, without breaking the existing functionality. Opening up the PR for you to review it!

Cannot install through cocoa pods

When I try to install it using Cocopods, I get an error like this:

Anokhi@GajendrasLaptop CheckIn % pod install
Analyzing dependencies
[!] Unable to find a specification for EasyConfetti

You have either:

  • out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
  • mistyped the name or version.
  • not added the source repo that hosts the Podspec to your Podfile.

my pod file

platform :ios, '13.0'

target 'CheckIn' do

use_frameworks!

pod 'EasyConfetti'
end

Image Opacity?

Is there an opacity pre-configured to the particle? Some of the images aren't the correct colors when using this.

Release for Swift 4.2

Hi!

Just wanted to ask/remind you to release the new version for Swift 4.2 to CocoaPods - I can see master is already patched. :)

How to display the animation is coming from the top from starting.

Hi,
I'm using the pod in my project. When i start the animation with the code
self.cheerView.start()
The animation is displaying like the view already fill with particles and showing the animation.
I want to display the animation like the particles starts from the top and getting down like in current animation. but currently particles are displayed on the view(i.e not started from the top) continued the animation. How to implement the animation that is starting from the top of the view.

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.