AJParticlesLoadingView
AJParticlesLoadingView
is a simple subclass of UIView for creating amazing particles loading animation with using Sprite Kit
. Our Xcode provides built-in SpriteKit Particle File which are being used to achieve different kinds of loading particles.
Requirements
iOS 11.0 and Swift 5 and above
Installation
- Just Drag and Drop AJParticlesLoadingView folder in your project.
- By default we are using some images which are being loaded as particles.
- For using your images as particle just add them in Sprites folder. Then add your image name in
Particle Image
enum which is inParticle Type
file.
NOTE: For better result use image of atleast 128*128 dimension
Usage
To see it in action clone the repo and run the sample project. It will show AJParticlesLoadingView is loaded. For using it in your project :
- Take a UIView from storyboard where you want to load particles.
- Assign that UIView class of AJParticlesLoadingView.
- Set the
particleImage
andparticleEffect
var objParticlesLoadingView: AJParticlesLoadingView!
objParticlesLoadingView.particleImage = .heart // Particle Image
objParticlesLoadingView.particleEffect = .fire // Particle Effect Type
- Now for handling animation simply use:
objParticlesLoadingView.startAnimating()
objParticlesLoadingView.stopAnimating()
Customizations
//For changing the particle image
objAJParticlesLoadingView.particleImage = .heart // you will get all added image here
//For changing the particle image
objAJParticlesLoadingView.particleEffect = .fire // you will get all added animations here
// Duration in seconds for completing the animation around the border of a view
objAJParticlesLoadingView.duration = 2.0
// The size of each particle images which are being used for loading particles
objAJParticlesLoadingView.particlesSize = 8.0
// The speed at which particles are being loaded inside a view
objAJParticlesLoadingView.particlesSpeed = 70.0
License
AJParticlesLoadingView
is available under the MIT license. See the LICENSE file for more info.
Author
For any queries and suggestions reach out at arpit.cor@gmail.com