Rotate UIButton 360 degrees

后端 未结 8 896
青春惊慌失措
青春惊慌失措 2021-02-07 01:52

I\'ve been trying to run an animation that rotates my UIButton 360 degrees using this code:

UIView.animateWithDuration(3.0, animations: {
  self.vin         


        
8条回答
  •  被撕碎了的回忆
    2021-02-07 02:18

    in Swift 3 :

    UIView.animate(withDuration:0.5, animations: { () -> Void in
      button.transform = CGAffineTransform(rotationAngle: CGFloat(M_PI))
    })
    
    UIView.animate(withDuration: 0.5, delay: 0.45, options: .curveEaseIn, animations: { () -> Void in
      button.transform = CGAffineTransform(rotationAngle: CGFloat(M_PI * 2))
    }, completion: nil)
    

提交回复
热议问题