diff options
Diffstat (limited to 'Sora/Views/Post/Grid')
| -rw-r--r-- | Sora/Views/Post/Grid/PostGridView.swift | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift index dc6546d..6d1d198 100644 --- a/Sora/Views/Post/Grid/PostGridView.swift +++ b/Sora/Views/Post/Grid/PostGridView.swift @@ -111,6 +111,22 @@ struct PostGridView: View { ) .frame(minHeight: 250) } + .gesture( + DragGesture() + .onEnded { value in + if value.startLocation.x < 50 && value.translation.width > 100 { + manager.goBackInHistory() + debugPrint("ContentView: Swipe left, \(manager.searchHistory)") + } + + if value.startLocation.x > (UIScreen.main.bounds.width - 50) + && value.translation.width < -100 + { + manager.goForwardInHistory() + debugPrint("ContentView: Swipe right, \(manager.searchHistory)") + } + } + ) } } |