宽容他人,放过自己。

swift旋转动画

Posted on By anchoriteFili

//基础动画-旋转动画
    func rotationAnimation() -> CABasicAnimation {
        
        let basicAnimation = CABasicAnimation.init(keyPath: "transform.rotation.z")
        
        basicAnimation.toValue = NSNumber.init(float: (Float)(M_PI*2))
        basicAnimation.duration = 2.0;
        basicAnimation.repeatCount = MAXFLOAT
        basicAnimation.removedOnCompletion = false;
        basicAnimation.setValue((Float)(M_PI*2), forKey: "kCAMediaTimingFunctionEaseInEaseOut")
        
        return basicAnimation;
        
    }