CropImageView icon indicating copy to clipboard operation
CropImageView copied to clipboard

Pinch to zoom freezes app.

Open pmasonuh opened this issue 3 years ago • 2 comments

Hi, the zoom at the bottom works fine, but when I pinch to zoom and release the cropper freezes the app.

iOS 15+, SwiftUI 5+, Xcode 13+

pmasonuh avatar Mar 04 '22 19:03 pmasonuh

It seems like there is an issue with SwiftUI's MagnificationGesture(). I am researching other ways of zooming. https://developer.apple.com/forums/thread/689117

johngoren avatar Feb 07 '23 14:02 johngoren

I fixed it by dispatching scale changes asynchronously with DispatchQueue.main.async. May do a pull request for this if i have time.

One theory for freezes like this is that GeometryReader goes into an endless loop, which does not happen if the scale change is updated in an async manner.

johngoren avatar Feb 07 '23 14:02 johngoren