Interactive Bottom Sheet (Variation of joomcode-BottomSheet)
Bottom Sheet component is designed to handle content while allowing interaction in rootView (similar to IOS sheet)
- ✅ pass it a controller view and it will present it in a drawer with these configurations: ✅ Custom Corner Radius ✅ Option to handle Orientation Changes ✅ ChildView interuption of gestures
- ✅ Resizable by setting preferedContentSize (Animated)
- ✅ Animated Opening, closing, resizing, dragging
To integrate Bottom Sheet into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift:
dependencies: [
.package(url: "https://github.com/MinlyInc/InteractiveDrawer", from: "2.0.0")
]CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ bundle installTo integrate BottomSheet into your Xcode project using CocoaPods, specify it in your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target '<Your Target Name>' do
pod 'BottomSheet', :git => 'https://github.com/MinlyInc/InteractiveDrawer'
endThis repo contains demo, which can be a great start for understanding Bottom Sheet usage, but here are simple steps to follow:
- Create
UIViewControllerto present and set content's size by preferredContentSize property - Present by using presentBottomSheet(viewController:configuration:)
If you want to build flows, use BottomSheetNavigationController
presentBottomSheetInsideNavigationController(
viewController: viewControllerToPresent,
configuration: .default
)You can customize appearance passing configuration parameter
presentBottomSheet(
viewController: viewControllerToPresent,
configuration: BottomSheetConfiguration(
cornerRadius: 10,
bottomSheetOrientation: .portrait,
gestureInterceptView: viewController.gestureInterceptorView
),
canBeDismissed: {
// return `true` or `false` based on your business logic
true
},
dismissCompletion: {
// handle bottom sheet dismissal completion
}
)