The Kraken The Kraken - 4 months ago 70
iOS Question

AVCaptureDevice Camera Zoom

I have a simple AVCaptureSession running to get a camera feed in my app and take photos. How can I implement the 'pinch to zoom' functionality using a

UIGestureRecognizer
for the camera?

Answer

Many have tried to do this by setting the transform property on the layer to CGAffineTransformMakeScale(gesture.scale.x, gesture.scale.y); See here for a full fledged implementation of pinch-to-zoom.

Comments