Latest 0.1.0
Homepage https://github.com/Ryucoin/Particles
License MIT
Platforms ios 12.0
Authors

Build Status
codecov
Version
License
Platform

Particles is a native swift adaption of particles.js and inspired by this stackoverflow question.

Installation

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

pod 'Particles'

Usage

You must import the Particles pod.

import Particles

let particlesView = ParticlesView(frame: view.frame)
view.addSubview(particlesView)

You can also initialize the ParticlesView with three optional parameters:


var bgColor: UIColor = .clear                 // The color of the background of the view
var particlesColor: UIColor = .black          // The color of the particles and the lines connecting them
var density: ParticleDensity = .extraLight    // How densely packed the view is with particles
var speed: ParticleSpeed = .normal            // How fast the particles are moving

The ParticleDensity enum has five cases:

.extraLight
.light
.normal
.dense
.extraDense

The ParticleSpeed enum has three cases:

.quick
.normal
.slow

bgColor, particlesColor, density and speed can be changed after initializaiton. Changing density will not cause the particles to be relayed out, but will either add or remove the needed amount of particles based on the new density.

Example

An example project is available in the ParticlesExample target to demonstrate the capabilities.

The default ParticlesView look like this (with the black background and white particles color):

defaultparticles

It can be customized to your specific liking, such as like this (with a blue background and red particles color):

customparticles

License

Particles is available under the MIT license.

Latest podspec

{
    "name": "Particles",
    "version": "0.1.0",
    "summary": "A native swift framework for creating particles.",
    "homepage": "https://github.com/Ryucoin/Particles",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "WyattMufson": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Ryucoin/Particles.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "12.0"
    },
    "swift_version": "4.2",
    "source_files": "Particles/Classes/**/*"
}

Pin It on Pinterest

Share This