ios - Disable Max Zoom -
i'm making camera , has pinch zoom. i'm trying find way disable maximum zoom level. here code...
func pinch(pinch: uipinchgesturerecognizer) { let device = avcapturedevice.defaultdevicewithmediatype(avmediatypevideo) let pinchvelocitydividerfactor:cgfloat = 10 if pinch.state == uigesturerecognizerstate.changed { { try device.lockforconfiguration() let desiredzoomfactor = device.videozoomfactor + atan2(pinch.velocity, pinchvelocitydividerfactor) device.videozoomfactor = max(1, min(desiredzoomfactor, device.activeformat.videomaxzoomfactor)) device.unlockforconfiguration() } catch { // handle error return } } }
is there anyway not have camera have max zoom snapchat? thanks!
Comments
Post a Comment