Swift 3.0 does not have a method called CGAffineTransformScale
.
func didPinchGesture(pinchRecognizer : UIPinchGestureRecognizer) {
if let view = pinchRecognizer.view {
view.transform = CGAffineTransformScale(view.transform,
recognizer.scale, recognizer.scale)
pinchRecognizer.scale = 1
}
}
scaleBy
does not autocomplete but added to CGAffineTransform
scaleBy
throws error, since scale
is not a property of CGAffineTransform anymore:
CGAffineTransform.scaledBy(view.transform, pinchRecognizer.scale, pinchRecognizer.scale)
.
What is the best way to configure the pinch gesture recognizer with Swift 3.0?