Rotating UIButton

后端 未结 4 1053
攒了一身酷
攒了一身酷 2021-01-20 11:33

I\'ve been trying to rotate a button using the following method:

-(IBAction)rotate:(id)sender{
    CGPoint pencilCenter = pencil.center;
    [pencil setCente         


        
4条回答
  •  清歌不尽
    2021-01-20 12:22

    Well, the docs say: "...the specified animations are started immediately on another thread ...". Now, all UIKit code is NOT thread safe. So, maybe it helps if instead calling your UI setters (setTransform, setCenter) from the completion block (which runs in a separate thread) to call them using performSelectorOnMainThread:withObject:.

提交回复
热议问题