CADisplayLink

CADisplayLink 是一个用于显示的定时器,  它可以让用户程序的显示于屏幕的硬件刷新保持同步。 

 一   创建CADisplayLink对象 

       可以用 CADisplayLink 的静态创建函数 

      + (CADisplayLink *)displayLinkWithTarget:(id)target
                                selector:(SEL)sel

   也可以用 UIScreen的成员函数 

     - (CADisplayLink *)displayLinkWithTarget:(id)target
                                selector:(SEL)sel

 

二  CADisplayLink的属性 

 @property(readonlynonatomicCFTimeInterval duration

 @property(nonatomicNSInteger frameInterval

 @property(readonlynonatomicCFTimeInterval timestamp

 

   duration 是只读的, 表示屏幕刷新的间隔

   frameInterval 是表示定时器被触发的间隔, 默认值是1, 就是表示跟硬件刷新频率一致。 

   timestamp 是只读的, 表示上次屏幕渲染的时间。 

 

猜你喜欢

转载自www.cnblogs.com/feng9exe/p/8856514.html