Last active
December 15, 2015 23:08
-
-
Save timarnold/5337684 to your computer and use it in GitHub Desktop.
CADisplayLink setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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