Rotate UIButton 360 degrees

后端 未结 8 874
青春惊慌失措
青春惊慌失措 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:28

    Swift 5. Try this, it worked for me

    UIView.animate(withDuration: 3) {
      self.yourButton.transform = CGAffineTransform(rotationAngle: .pi)
      self.yourButton.transform = CGAffineTransform(rotationAngle: .pi * 2)
     }
    

提交回复
热议问题