Zooming image in gesture recogniser ios goes out of bounds

204 Views Asked by At

I am trying to zoom image within frame of image i added a view in which i add 2 images one is frame and one is image that pinch zoomed code is working successfully but image goes out of view when zoomed. here is my code

      @objc func pinchRecognized(pinch: UIPinchGestureRecognizer) {
           if let view = pinch.view {
               view.transform = view.transform.scaledBy(x: pinch.scale, y: pinch.scale)
               pinch.scale = 1
           }
       } 
0

There are 0 best solutions below