Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

A bug about kPOPLayerRotationY. #361

Open
HarwordLiu opened this issue Apr 5, 2017 · 0 comments
Open

A bug about kPOPLayerRotationY. #361

HarwordLiu opened this issue Apr 5, 2017 · 0 comments

Comments

@HarwordLiu
Copy link

Why the same code, X is normal, but when the rotation is Y and animation is finished, the view is crazy? Isn't this bug about kPOPLayerRotationY has not been fixed?

func configuraView() {
    
    aniView.backgroundColor = UIColor.green
    aniView.center = view.center
    view.addSubview(aniView)
    
    let tapGes = UITapGestureRecognizer(target: self, action: #selector(tap(_:)))
    aniView.addGestureRecognizer(tapGes)
    
}

func tap(_ sender: UITapGestureRecognizer) {
    aniView.layer.pop_removeAllAnimations()
    
    unowned let weakSelf = self
    
    
    let rotation = POPBasicAnimation(propertyNamed: kPOPLayerRotationY)
    rotation?.toValue = Double.pi / 2
    rotation?.completionBlock = ({(animation, finished) in
        let finishedAni = POPBasicAnimation(propertyNamed: kPOPLayerRotationY)
        
 //            finishedAni?.fromValue = Double.pi / 2
        finishedAni?.toValue = Double.pi
        finishedAni?.duration = 1
        
        weakSelf.aniView.backgroundColor = UIColor.blue
        weakSelf.aniView.layer.pop_add(finishedAni, forKey: "finished")
    })
    
    aniView.layer.pop_add(rotation, forKey: "rotation")


}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant