I made a SwiftUI component so you can drag anywhere to dismiss a view

Just add a modifier lazyPop() and you can enable the drag-anywhere-to-dismiss feature you see in apps like Instagram.


struct DetailsViewWithLazyPop: View {
     var body: some View {
          Text("Lazy pop enabled. Swipe anywhere to dismiss.")
          .lazyPop()
     }
}


Demo gif: https://i.redd.it/iar3buls48241.gif


GitHub: https://github.com/joehinkle11/Lazy-Pop-SwiftUI


I'm thinking about turning it into a Swift Package or Cocopod. If that's something someone wants, let me know.

Good.


But where is the question about the code ?

I made a SwiftUI component so you can drag anywhere to dismiss a view
 
 
Q