Skip to content

Commit 354b801

Browse files
committed
Add an animation on double tap zoom
1 parent a981ef8 commit 354b801

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Views/ScalableView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ struct ScalableView<Content: View>: View {
1212
.gesture(
1313
TapGesture(count: 2)
1414
.onEnded({ _ in
15-
self.finalAmount = self.finalAmount != 1.0 ? 1.0 : 2.0
15+
withAnimation {
16+
self.finalAmount = self.finalAmount != 1.0 ? 1.0 : 2.0
17+
}
1618
}))
1719
.gesture(
1820
MagnificationGesture()

0 commit comments

Comments
 (0)