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
// Camera permission handling - iOS 8 | |
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted){ | |
if (granted) | |
{ | |
dispatch_sync(dispatch_get_main_queue(), ^{ | |
// Present camera controller here | |
}); | |
} | |
else | |
{ |
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
// Setup horizontal motion effect | |
UIInterpolatingMotionEffect *horizontalInterpolation = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis]; | |
horizontalInterpolation.minimumRelativeValue = @-kMotionViewControllerInterpolationValue; | |
horizontalInterpolation.maximumRelativeValue = @kMotionViewControllerInterpolationValue; | |
// Setup vertical motion effect | |
UIInterpolatingMotionEffect *verticalInterpolation = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis]; | |
verticalInterpolation.minimumRelativeValue = @-kMotionViewControllerInterpolationValue; | |
verticalInterpolation.maximumRelativeValue = @kMotionViewControllerInterpolationValue; | |