Skip to content

Commit eaba59f

Browse files
committed
Restore animation when releasing pinch
See Jake-Short#27
1 parent 5da62c6 commit eaba59f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sources/ImageViewer/PinchToZoom.swift

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

7171
case .ended, .cancelled, .failed:
72-
isPinching = false
73-
scale = 1.0
74-
anchor = .center
75-
offset = .zero
72+
withAnimation(.interactiveSpring()) {
73+
isPinching = false
74+
scale = 1.0
75+
anchor = .center
76+
offset = .zero
77+
}
7678
default:
7779
break
7880
}

0 commit comments

Comments
 (0)