         animation.keyPath = "transform"
         animation.duration = duration
         animation.fromValue = NSValue(caTransform3D: originTransform)//bgLayer.transform
-        animation.toValue = NSValue(caTransform3D: desTransform!)
+        animation.toValue = NSValue(caTransform3D: desTransform)
         bgLayer.removeAnimation(forKey: "sianimation\(prevStep)")
         bgLayer.add(animation, forKey: "sianimation\(currStep)")
     }

    }
    
    public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
        if let transform = desTransform, flag {
            CATransaction.begin()
            CATransaction.setDisableActions(true)
            bgLayer.transform = transform
            bgLayer.removeAllAnimations()
            CATransaction.commit()
            let activeView = stepViews[currStep]

    private let tapRecognizer = UITapGestureRecognizer()
    private let swipeLeftRecognizer = UISwipeGestureRecognizer()
    private let swipeRightRecognizer = UISwipeGestureRecognizer()
    private var desTransform = CATransform3DIdentity
    private var originSize = CGSize.zero
    private var stepViews = [View]()
    private var prevStep: Int = 0
