Skip to content

Instantly share code, notes, and snippets.

@chashmeetsingh
Created May 29, 2016 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chashmeetsingh/21e48123031006f1c2fc0d7714fa7257 to your computer and use it in GitHub Desktop.
Save chashmeetsingh/21e48123031006f1c2fc0d7714fa7257 to your computer and use it in GitHub Desktop.
import UIKit
import SpriteKit
import ParticlesLoadingView
class ViewController: UIViewController {
lazy var loadingView: ParticlesLoadingView = {
let x = UIScreen.mainScreen().bounds.size.width / 2 - (75 / 2) - 200
let y = UIScreen.mainScreen().bounds.size.height / 2 - (75 / 2)
let view = ParticlesLoadingView(frame: CGRect(x: x, y: y, width: 75, height: 75))
view.particleEffect = .Laser
view.duration = 1.5
view.particlesSize = 15.0
view.clockwiseRotation = true
view.layer.borderColor = UIColor.lightGrayColor().CGColor
view.layer.borderWidth = 1.0
view.layer.cornerRadius = 15.0
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(loadingView)
loadingView.startAnimating()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment