**I have custom header view**

I want to dismiss (not hide) the bottom sheet when click in this custom close button.
I have read the documentation, but unfortunately, I couldn’t find anything that provides this customization. The .hide modifier doesn’t work well, as it doesn’t destroy the view; instead, it keeps it in its previous state. Additionally, the onDismiss { } closure doesn’t get triggered when switching to .hide.
I have gone a little bit deeper into the library and found out this:

It makes the configuration dismiss, which I think is what causes other things that totally destroy the view to get called! Unfortunately, it's an inaccessible property.
**Do you have any API or configuration that could help me out?**
`closeSheet()` gets called, when the BottomSheet decides to close itself. This may be the case when you use the provided close button or tap to dismiss behavior.
Behavior of `closeSheet()`:
1. sets the position to hidden (what you can do yourself)
2. closes all keyboards (what you can do yourself; endEditing is not exposed, but you can copy its implementation, see below)
3. it calls the user provided additional code to execute on dismiss
So if you have your own button for closing the sheet, your code looks like this:
```swift
func closeSheet() {
self.bottomSheetPosition = .hidden
self.endEditing()
// Additional code you would like to perform (previously onDismiss)
}
func endEditing() {
#if !os(macOS)
UIApplication.shared.endEditing()
#endif
}
#if !os(macOS)
import UIKit
extension UIApplication {
func endEditing() {
sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
#endif
```
You are suggesting that the BottomSheet library has some kind of private "destroy view" function, which is not the case.