/**
* 开始旋转
*/
- (void)statrRotating
{
//1秒内刷新60次
CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(update)];
//添加到消息循环,link才能工作
[link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
}
- (void)update
{
//transform要一直转,就要一直累加角度
self.centerWheel.transform = CGAffineTransformRotate(self.centerWheel.transform, M_PI / 200 );
}
CADisplayLink做定时器任务
最新推荐文章于 2019-10-26 20:32:36 发布