Skip to content

Instantly share code, notes, and snippets.

Created January 4, 2015 16:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
iOS present camera overlay view
//create an overlay view instance
OverlayView *overlay = [[OverlayView alloc]
initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGTH)];
//create a new image picker instance
UIImagePickerController *picker =
[[UIImagePickerController alloc] init];
//set source to video!
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
//hide all controls
picker.showsCameraControls = NO;
picker.navigationBarHidden = YES;
picker.toolbarHidden = YES;
//make the video preview full size
picker.wantsFullScreenLayout = YES;
picker.cameraViewTransform =
//set our custom overlay view
picker.cameraOverlayView = overlay;
//show picker
[self presentModalViewController:picker animated:YES];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment