DangerPaws
DangerPaws

Reputation: 846

How to disable Camera Zoom on iPhone (xcode)

I'm currently building an app that uses the iPhone camera. This may be an odd question but any idea how to disable the ability to zoom?

I've searched the internet high and low and so far I have come up with nothing. Any developers that may have some ideas, I'd love to hear from you!

Upvotes: 1

Views: 1594

Answers (2)

joel.d
joel.d

Reputation: 1631

Just adding a UIPinchGestureRecognizer to the camera's overlay view will disable the pinch to zoom. This way is better than intercepting all touches because it does not disable the tap to change focus gesture.

UIView *cameraOverlay = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
cameraOverlay.userInteractionEnabled = YES;
UIPinchGestureRecognizer *pinchRec = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(doPinch)];
[cameraOverlay addGestureRecognizer:pinchRec];
imagePicker.cameraOverlayView = cameraOverlay;

Upvotes: 0

Jonathan King
Jonathan King

Reputation: 1528

A guess would be to intercept all incoming touhces, by putting in a transoarent view in from of the camera view, and then handle touches of the shutter button manually. I don't think that this is part of the public API anyway.

Hope this helps,

Jonathan

Upvotes: 2

Related Questions