joomcode / BottomSheet

Bottom Sheet for iOS
https://medium.com/joomtech/bottom-sheet-shall-we-drop-the-formalities-400515255829
MIT License
309 stars 47 forks source link

can we disable the dismiss on swipe-down? #20

Closed mohabbasi1213 closed 1 year ago

mohabbasi1213 commented 1 year ago

I want to use BottomSheet as my loading view and not let the user dismiss it easily on swipe or outside tap. Is it possible?

mikhailmaslo commented 1 year ago

Hi!

It was just added to version 2.0.3, now you can conveniently specify if bottom sheet can be dismissed or not

presentBottomSheet(
    viewController: viewControllerToPresent,
    configuration: BottomSheetConfiguration(
        cornerRadius: 10,
        pullBarConfiguration: .visible(.init(height: 20)),
        shadowConfiguration: .init(backgroundColor: UIColor.black.withAlphaComponent(0.6))
    ),
    canBeDismissed: {
        // TODO: return `true` or `false` based on your business logic
        true
    }
)