Skip to content

Use CADisplayLink instead of NSTimer, dataSource updates#30

Merged
lxcid merged 3 commits intolxcid:masterfrom
zadr:master
Jul 7, 2013
Merged

Use CADisplayLink instead of NSTimer, dataSource updates#30
lxcid merged 3 commits intolxcid:masterfrom
zadr:master

Conversation

@zadr
Copy link
Contributor

@zadr zadr commented May 5, 2013

  • CADisplayLink is a more high-resolution timer, that fire on every screen vsync (every 16-17ms), as opposed to NSTimer's runloop-based operation (which only fires every 50-100ms).
  • Make collectionView:itemAtIndexPath:willMoveToIndexPath: optional, and, add a matching collectionView:itemAtIndexPath:didMoveToIndexPath:

lxcid added a commit that referenced this pull request Jul 7, 2013
Use CADisplayLink instead of NSTimer, dataSource updates
@lxcid lxcid merged commit c1f60d2 into lxcid:master Jul 7, 2013
@lxcid
Copy link
Owner

lxcid commented Jul 7, 2013

Sorry I took so long to reply. I like this update except for one small issue. Because with NSTimer, we can "assume" interval between callback to be 60 fps (as I hardcoded it) and since CADisplayLink is more dependent on the refresh rate of the screen, I felt it need a way to track the interval between frames.

I'll still merge this nevertheless but I'll create a new issue regarding my concern. Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants