JamesSedlacek / Routing

SwiftUI library for abstracting navigation logic from views
MIT License
353 stars 19 forks source link

onDismiss Handler for Sheets & FullScreenCovers #8

Closed JamesSedlacek closed 10 months ago

JamesSedlacek commented 11 months ago

This would add the ability to write an onDismiss completion handler closure for sheets and fullScreenCovers.

https://developer.apple.com/documentation/swiftui/view/sheet(ispresented:ondismiss:content:)

The sheet view modifier has an optional onDismiss closure that we want the ability to use.

Usage Example:

router.sheet(.settings, onDismiss: {
    print("Sheet dismissed!")
})

router.sheet(.settings) {
    print("Sheet dismissed!")
}

router.fullScreenCover(.settings, onDismiss: {
    print("FullScreenCover dismissed!")
})

router.fullScreenCover(.settings) {
    print("FullScreenCover dismissed!")
}
afathe7090 commented 11 months ago

please, check Pull Requests for this issue. @JamesSedlacek