IOS实现动画的几种简单方法

1.使用 NSTimer 来实现

 

[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(setNeedsDisplay) userInfo:nil repeats:YES];

 

 

 

2.使用 CADisplayLink 来实现

CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(setNeedsDisplay)]; 

[link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];

 

 

posted @ 2015-07-02 12:52  第三维  阅读(213)  评论(0编辑  收藏  举报