Open metallica1375 opened 2 months ago
Dismissing a notification
NotificationPresenter.shared.dismiss()
// with completion
NotificationPresenter.shared.dismiss(after: 0.5) { presenter in
// ...
}
Thanks for the hint, but when I call it, it won't work, e.g. in onTagGesture{} in my SwiftUI view component. although I added the onTapDismiss functionality in my fork using UITapGestureRecognizer, but I wanted to check if it can be done directly or not.
Ah you want to handle custom user interaction? See this sample code you need to disable style.canTapToHold
:
No no, I just want to simply dismiss the notification when the user taps anywhere on it
Yep, for that you need the above. Then you can use swift gesture handling as usual.
By default a user can only swipe to dismiss.
hey, thanks for your awesome library, how can I dismiss the toast or notification in swiftUI form?