I am trying to add an animation to my application using Lottie but I get this error and I still do not know how to solve it.
import UIKit
import Lottie
class ViewController: UIViewController {
@IBOutlet var animationView: AnimationView!
override func viewDidLoad() {
super.viewDidLoad()
startAnimation()
}
func startAnimation(){
animationView.setAnimation(named: "data")//error1
animationView.loopAnimation = true//error2
animationView.play()
}
}
The error that comes out:
Value of type 'AnimationView?' has no member 'setAnimation'
Value of type 'AnimationView?' has no member 'loopAnimation'