Skip to content

Commit 6f55312

Browse files
authored
Fixed zoom animation for remote image viewer
1 parent 702ccd0 commit 6f55312

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sources/ImageViewerRemote/ImageViewerRemote.swift

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

231231
case .ended, .cancelled, .failed:
232-
isPinching = false
233-
scale = 1.0
234-
anchor = .center
235-
offset = .zero
232+
withAnimation(.interactiveSpring()) {
233+
isPinching = false
234+
scale = 1.0
235+
anchor = .center
236+
offset = .zero
237+
}
236238
default:
237239
break
238240
}

0 commit comments

Comments
 (0)