I keep getting this error: Initializer for conditional binding must have Optional type, not 'LOTAnimationView' on the if let animationView = LOTAnimationView(name: "pop_heart") { line of code. I think the format of the code may be wrong. Can anyone guide me in the right direction? Thanks :)
override func viewDidLoad() {
super.viewDidLoad()
print("view loaded")
if let animationView = LOTAnimationView(name: "pop_heart") {
animationView.frame = CGRect(x: 0, y: 0, width: 400, height: 400)
animationView.center = self.view.center
animationView.contentMode = .scaleAspectFill
animationView.loopAnimation = true
animationView.animationSpeed = 0.5
view.addSubview(animationView)
animationView.play()
}}