AnimationView is written in swift. It is a subclass of UIView and highly customizable.
To install AnimationView, simply add AnimationView.swift
to your project.
Creating a AnimationView
let animationView = Animation(frame: self.view.bounds)
Set the colors with the .imageColors
property or you can use UIColor.randomColor()
animationView.colors = [UIColor.red, UIColor.green, UIColor.blue]
Add the subview
self.view.addSubview(animationView)
The BirthRate refers to number of emitted objects created every second. Set the birthrate with the .birthRate
property. The default birthrate is 2.0
animationView.birthRate = 2.0
To start the animation, use
animationView.startAnimation()
To stop the animation, use
animationView.stopAnimation()