A splash loading animation with ripple effect written in Swift.
Create an instance of HAKRippleGenerator and add it to your view:
let rippleView = HAKRippleGenerator(frame: CGRect(x: 0.0, y: 0.0, width: UIScreen.main.bounds.width, height: 180), duration: 0.4)
rippleView!.backgroundColor = UIColor.clear
self.view.addSubview(rippleView!)
Position the view using center property:
let screenCenter = CGPoint(x: UIScreen.main.bounds.width/2, y: UIScreen.main.bounds.height/2)
rippleView.center = CGPoint.init(x: screenCenter.x, y: screenCenter.y/0.55)
Start animation:
self.rippleView.startAnimating()
Stop animation:
rippleView.stopAnimating()