To run the example project, clone the repo, and run pod install
from the Example directory first.
BottomSheetDemo.mov
Hold bottom sheet as a local reference.
var bottomSheet: DAOBottomSheet?
Create bottom sheet via DAOBottomSheet/init(parentVC:title:type:)
.
bottomSheet = DAOBottomSheet(parentVC: self, title: "Title", type: .flexible)
bottomSheet?.rootVC.delegate = self
bottomSheet?.show()
Simply add your custom view via delegation function DAOBottomSheetDelegate/setupDAOBottomSheetContentUI(bottomSheet:)
.
func setupDAOBottomSheetContentUI(bottomSheet: DAOBottomSheetViewController) -> UIView? {
let view = UIView()
contentView.addSubview(view)
view.snp.makeConstraints {
$0.height.equalTo(200)
}
return view
}
If you have a custom scroll view(or table view, collection view, etc), implement DAOBottomSheetDelegate/setupCustomContentScrollView(bottomSheet:)
instead.
func setupCustomContentScrollView(bottomSheet: DAOBottomSheetViewController) -> UIScrollView? {
return <#YourCustomScrollableView#>
}
- Swift 5.0
- iOS 15+
DAOBottomSheet is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'DAOBottomSheet'
daoseng33, [email protected]
DAOBottomSheet is available under the MIT license. See the LICENSE file for more info.