Creates a customizeable loading view with a bouncing image animation.
Copy and paste the animationView
struct to your project
-
Put:
var loadingAnimation = animationView()
in ViewController class -
Set up loadingAnimation by setting up the superView and image (optional):
loadingAnimation.superView = scrollView
if let image = UIImage(named: "IMAGE_NAME") { loadingAnimation.image = image }
-
Start animation:
loadingAnimation.startAnimation()
-
Stop animation:
loadingAnimation.stopAnimation()