Skip to content

Commit 702ccd0

Browse files
committed
Restore animation when releasing pinch
1 parent 53dfdd2 commit 702ccd0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sources/ImageViewer/ImageViewer.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,12 @@ class PinchZoomView: UIView {
206206
offset = CGSize(width: location.x - startLocation.x, height: location.y - startLocation.y)
207207

208208
case .ended, .cancelled, .failed:
209-
isPinching = false
210-
scale = 1.0
211-
anchor = .center
212-
offset = .zero
209+
withAnimation(.interactiveSpring()) {
210+
isPinching = false
211+
scale = 1.0
212+
anchor = .center
213+
offset = .zero
214+
}
213215
default:
214216
break
215217
}

0 commit comments

Comments
 (0)