Has anyone had success with "swipe anywhere to go ...
# compose-ios
p
Has anyone had success with "swipe anywhere to go back" behavior in CMP? Edge swiping works just fine but I notice that on our swiftui implementation I can swipe pretty much anywhere on the screen to go back whereas our CMP implementation needs it to be at the edge. For reference we're using nav3
k
You could implement it on your own: take a look at the navigation event library. You need a container to handle swipes and to send a progressive back event into the library
p
That makes sense. That's the direction I'm leaning, I wanted to make sure there wasn't some obvious setting or something I was missing. Thanks!
u
Unfortunately there is no custom solution. I was trying to do something similar like Slack and X has but failed to do so. I guess my maths was poor at handling that logic. Especially if the user decides to cancel it midway.
p
It ended up working out pretty well for us, still need to do some more polishing though. Navigation library handles a lot of that cancellation logic automatically
u
Ahh right. I did not try the new navigation library. Would be really grateful if you can share a gist for this.
p
Yeah I can share something when I'm back at my desk, fair warning it is just AI generated so the quality probably isn't great, I haven't done a polish pass yet
u
Hey whatever you can. Happy to wait if you do it past the polish stage
p
Sorry for the delay it's been a bit hectic. https://gist.github.com/keeslinp/08b2181715d3b458fa3c21a13a2d1c07. This has not shipped to production (and won't any time soon) so don't trust it too much
u
No worries. Thanks a lot man