Drastically improve image viewer
Changelog-Added: Drastically improved image viewer Closes: #349
This commit is contained in:
1 parent
d1e7de5dcb
commit
98c24147e8
3 files changed
+185
-111
No files matched your search
@@ -8,6 +8,7 @@
|
||||
import SwiftUI
|
||||
|
||||
struct SwipeToDismissModifier: ViewModifier {
|
||||
let minDistance: CGFloat?
|
||||
var onDismiss: () -> Void
|
||||
@State private var offset: CGSize = .zero
|
||||
|
||||
@@ -16,7 +17,7 @@ struct SwipeToDismissModifier: ViewModifier {
|
||||
.offset(y: offset.height)
|
||||
.animation(.interactiveSpring(), value: offset)
|
||||
.simultaneousGesture(
|
||||
DragGesture()
|
||||
DragGesture(minimumDistance: minDistance ?? 10)
|
||||
.onChanged { gesture in
|
||||
if gesture.translation.width < 50 {
|
||||
offset = gesture.translation
|
||||
|
||||
Reference in new issue
Block a user