BottomSheetPresentation 0.8.0

BottomSheetPresentation 0.8.0

Maintained by Jeff Kelley.


A UIPresentationController and attendant clases for iOS to present a view controller pinned to the bottom of the screen like an action sheet.

Version Documentation Carthage compatible Swift Package Manager License Platform


Swift Package Manager

To use BottomSheetPresentation with the Swift Package Manager, add it as a dependency to your project from within Xcode or as a dependency in your Package.swift file.


To use BottomSheetPresentation with CocoaPods, add a dependency to your Podfile:

target 'MyAwesomeApp' do
  pod 'BottomSheetPresentation'

Then run pod install and use the generated .xcworkspace to open your project.


To use BottomSheetPresentation with Carthage, add a dependency to your Cartfile:

github "Detroit-Labs/BottomSheetPresentation"

Run carthage update to build the framework. Then follow the rest of the steps in Carthage’s README to add the framework to your project, configure a Run Script build phase, etc.

Using BottomSheetPresentation


To use BottomSheetPresentation, create a BottomSheetPresentationManager and set it as the transitioningDelegate of the view controller you want to present, then set the modalPresentationStyle of the view controller to .custom.

let manager = BottomSheetPresentationManager() // Save this reference somewhere
let viewControllerToPresent = 
viewControllerToPresent.transitioningDelegate = manager
viewControllerToPresent.modalPresentationStyle = .custom

present(viewControllerToPresent, animated: true, completion: nil)


BottomSheetPresentation also works with Objective-C:

BottomSheetPresentationManager *manager = [[BottomSheetPresentationManager alloc] init];

UIViewController *viewControllerToPresent = …;
viewControllerToPresent.transitioningDelegate = manager;
viewControllerToPresent.modalPresentationStyle = UIModalPresentationCustom;

[self presentViewController:viewControllerToPresent


To correctly compute the height of the presented view controller, it must either satisfy Auto Layout constraints for a height using systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) or have a non-zero preferredContentSize.