Skip to content

Instantly share code, notes, and snippets.

@cqa02303
Created December 21, 2009 06:37
Show Gist options
  • Save cqa02303/260816 to your computer and use it in GitHub Desktop.
Save cqa02303/260816 to your computer and use it in GitHub Desktop.
{
UIImagePickerController *controller = [[[UIImagePickerController alloc] init] autorelease];
controller.sourceType = UIImagePickerControllerSourceTypeCamera;
controller.cameraOverlayView = self.cameraOverlay;
[self performSelector:@selector(removeOverlayView:) withObject:controller afterDelay:0.1f];
controller.allowsEditing = YES;
controller.delegate = self;
// ニュッと出るのでは無く、フェードする
controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:controller animated:YES];
}
// overlay viewを外すけどlayerツリーは残す
- (void) removeOverlayView:(UIImagePickerController*)controller {
// overlayの親子を把握する
CALayer *splayer = self.cameraOverlay.layer.superlayer;
controller.cameraOverlayView = nil;
[splayer addSublayer:self.cameraOverlay.layer];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment