UIImagePickerController w/ cameraOverlayView: image offset is changed

Number:rdar://30513073 Date Originated:14-Feb-2017 05:35 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:10.3 beta 2
Classification:UI/Usability Reproducible:Always
When using UIImagePickerController the image is shifted 44 pt (on iPhone 7 and 7 plus) downwards when tapping the shutter button.

1) this looks really ugly because it's not animated

2) a bigger issue: if a cameraOverlayView is set, the image shifts below the overlay. Imagine an avatar picker with a circular overlay to let the user center the face within the circle. After taking the photo, the face is shifted 44 pt and is not in the circle anymore. See the attached photos of the camera preview and the photo confirmation view.

For reference, this is my code to generate the circular overlay:

	UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
	imagePicker.delegate = self;
	imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
	UIView *overlay = [[UIView alloc] initWithFrame:self.view.window.bounds];
	overlay.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
	overlay.userInteractionEnabled = NO;
	CGMutablePathRef path = CGPathCreateMutable();
	CGPathAddArc(path, &CGAffineTransformIdentity, overlay.center.x, overlay.center.y, self.view.$width/2 - 10, 0, 2*M_PI, NO);
	CGPathAddRect(path, &CGAffineTransformIdentity, UIEdgeInsetsInsetRect(overlay.bounds, UIEdgeInsetsMake(44, 0, 123, 0))); // ugly
	CAShapeLayer *mask = CAShapeLayer.layer;
	mask.path = path;
	mask.fillRule = kCAFillRuleEvenOdd;
	overlay.layer.mask = mask;
	imagePicker.cameraOverlayView = overlay;

	[self presentViewController:imagePicker animated:YES completion:nil];

The avatar image picker used in Contacts.app doesn't exhibit this issue: the image is not shifted after pushing the shutter button.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!