I'm trying to create a resizable face with UIPinchGestureRecognizer. All the tutorials online tell me to always reset the scale to 1, such as this code:
func changeScale(byReactingTo pinchRecognizer: UIPinchGestureRecognizer)
{
switch pinchRecognizer.state {
case .changed,.ended:
scale *= pinchRecognizer.scale
pinchRecognizer.scale = 1
default:
break
}
}
where scale is a CGFloat that is related to the size of the face.
However, I couldn't find any reasonable explanation as to why pinchRocgnizer.scale always must be reset to 1 after the user pinches. I understand that deleting it could cause erratic behavior, but why?