每次单击按钮时如何将UIButton旋转90度并跟踪每个旋转的位置/角度?
这是我到目前为止的代码,但它只旋转一次:
@IBAction func gameButton(sender: AnyObject) {
UIView.animateWithDuration(0.05, animations: ({
self.gameButtonLabel.transform = CGAffineTransformMakeRotation(CGFloat(M_PI_2))
}))
}
Run Code Online (Sandbox Code Playgroud)