Skip to content

enricmacias/SwiftFireworks

Repository files navigation

SwiftFireworks

CI Status Version License Platform

Description

A library to easily show 2D animated fireworks on a UIView

alt tag

Requirements

  • iOS 8.0

In detail

SwiftFireworks is a light library that let's you show animated fireworks using CoreAnimation. You only need to specify which UIView you want to show the firework and the position of this one. The library provides two different methods to show them:

// Shows only one firework at a time.
func showFirework(inView view:UIView, andPosition position:CGPoint, radius:CGFloat? = nil, sparkLength:CGFloat? = nil, sparkThickness:CGFloat? = nil, sparkSeparation:CGFloat? = nil, color:UIColor? = nil)
// Shows a set of fireworks
func showFireworkSet(inView view:UIView, andPosition position:CGPoint, numberOfFireworks num:UInt? = nil) 

Usage

  1. Import SwiftFireworks library into the file you want to show the fireworks
import SwiftFireworks
  1. Shoot a firework to the UIView you want
SwiftFireworks.sharedInstance.showFirework(inView: view, andPosition: CGPoint(x: posX, y: posY))

Installation

Cocoapods

To install it, simply add the following line to your Podfile:

pod "SwiftFireworks"

Carthage

To install it, add the following line to your Cartfile:

github "enricmacias/SwiftFireworks"

Run carthage update to build the framework and drag the built SwiftFireworks.framework into your Xcode project.

Author

Enric Macias Lopez, enric.macias.lopez@gmail.com

License

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

About

A library to easily show 2D animated fireworks on a UIView

Resources

License

Stars

Watchers

Forks

Packages

No packages published