ios - Limit the min value of videoZoomFactor when pinching to zoom. -
when pinch zoom using method below videozoomfactor go below 1 , app crash. how can modify method when try zoom min value zoom factor doesn't go below 1. looking natural zoom , not adding pinch scale factor 1.
-(void) handlepinchtozoomrecognizer:(uipinchgesturerecognizer*)pinchrecognizer { const cgfloat pinchvelocitydividerfactor = 5.0f; nslog(@"%f", atan(pinchrecognizer.velocity / pinchvelocitydividerfactor)); if (pinchrecognizer.state == uigesturerecognizerstatechanged) { nserror *error = nil; if ([inputdevice lockforconfiguration:&error]) { inputdevice.videozoomfactor = inputdevice.videozoomfactor + atan(pinchrecognizer.velocity / pinchvelocitydividerfactor); [inputdevice unlockforconfiguration]; } else { nslog(@"error: %@", error); } } }
Comments
Post a Comment