Skip to content

Instantly share code, notes, and snippets.

@timarnold
Last active December 15, 2015 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timarnold/5337684 to your computer and use it in GitHub Desktop.
Save timarnold/5337684 to your computer and use it in GitHub Desktop.
CADisplayLink setup
CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(update:)];
link.frameInterval = 60; // every 60 frames = 1 second send the update: message
link.paused = NO; // default is NO
[link addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
- (void)update:(CADisplayLink *)displayLink {
// Do all the things!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment