Latest 0.3.0
Homepage https://github.com/detroit-labs/BottomSheetPresentation
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

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
License
Platform

Installation

CocoaPods

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

target 'MyAwesomeApp' do
  pod 'BottomSheetPresentation'
end

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

Carthage

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.

Manually

To integrate BottomSheetPresentation manually into your project, drag BottomSheetPresentation.swift into your Xcode project.

Using BottomSheetPresentation

Swift

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)

Objective-C

BottomSheetPresentation also works with Objective-C:

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

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

[self presentViewController:viewControllerToPresent
                   animated:YES
                 completion:NULL];

Requirements

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.

Latest podspec

{
    "name": "BottomSheetPresentation",
    "version": "0.3.0",
    "summary": "A UIPresentationController for iOS to present a view controller pinned to the bottom of the screen.",
    "description": "A UIPresentationController and attendant clases for iOS to present a view controller pinned to the bottom of the screen like an action sheet. Integrates with the UIKit view controller presentation hooks to involve as little integration surface as possible.",
    "homepage": "https://github.com/detroit-labs/BottomSheetPresentation",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Jeff Kelley": "[email protected]"
    },
    "social_media_url": "https://twitter.com/SlaunchaMan",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Detroit-Labs/BottomSheetPresentation.git",
        "tag": "0.3.0"
    },
    "source_files": "Code/*.swift",
    "frameworks": "UIKit",
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This