Skip to content

Instantly share code, notes, and snippets.

@zapsleep
Created July 29, 2013 11:51
Show Gist options
  • Save zapsleep/6103812 to your computer and use it in GitHub Desktop.
Save zapsleep/6103812 to your computer and use it in GitHub Desktop.
Getters for gyroscope in DVParallaxView
-(CADisplayLink *)displayLink {
if (!_displayLink) {
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(displayLinkHandler)];
}
return _displayLink;
}
-(CMMotionManager *)motionManager {
if (!_motionManager) {
_motionManager = [[CMMotionManager alloc] init];
_motionManager.deviceMotionUpdateInterval = 0.03f;
}
return _motionManager;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment