Skip to content
An elegant and highly customizable presentation API for constructing bottom sheet modals on iOS.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
PanModal Limit when we adjust container view frame Apr 4, 2019
PanModalDemo.xcodeproj Fix Tests Scheme. Mar 14, 2019
Sample Merge pull request #5 from Marcocanc/intrinsic-height Mar 14, 2019
Screenshots Update panModal.gif Feb 28, 2019
Tests Replace `isPanScrollEnabled` with `shouldRespond(to ..` (#10) Mar 20, 2019
.gitignore Update Mar 14, 2019 Update Mar 13, 2019
LICENSE Initial commit Feb 27, 2019
PanModal.podspec Update Mar 13, 2019

Screenshot Preview

Platform: iOS 10.0+ Language: Swift 4 CocoaPods compatible Carthage compatible License: MIT



  • Supports any type of UIViewController
  • Seamless transition between modal and content
  • Maintains 60 fps performance


PanModal requires iOS 10+ and is compatible with Swift 4.2 projects.


pod 'PanModal'
github "slackhq/PanModal"


PanModal was designed to be used effortlessly. Simply call presentPanModal in the same way you would expect to present a UIViewController


The presented view controller must conform to PanModalPresentable to take advantage of the customizable options

extension YourViewController: PanModalPresentable {

    var panScrollable: UIScrollView? {
        return nil


If the presented view controller has an embedded UIScrollView e.g. as is the case with UITableViewController, panModal will seamlessly transition pan gestures between the modal and the scroll view

class TableViewController: UITableViewController, PanModalPresentable {

    var panScrollable: UIScrollView? {
        return tableView

Adjusting Heights

Height values of the panModal can be adjusted by overriding shortFormHeight or longFormHeight

var shortFormHeight: PanModalHeight {
    return .contentHeight(300)

var longFormHeight: PanModalHeight {
    return .maxHeightWithTopInset(40)

Updates at Runtime

Values are stored during presentation, so when adjusting at runtime you should call panModalSetNeedsLayoutUpdate()

func viewDidLoad() {
    hasLoaded = true

    panModalTransition(to: .shortForm)

var shortFormHeight: PanModalHeight {
    if hasLoaded {
        return .contentHeight(200)
    return .maxHeight

Sample App

Check out the Sample App for more complex configurations of PanModalPresentable, including navigation controllers and stacked modals.


Option + click on any of PanModal's methods or notes for detailed documentation.

Screenshot Preview


We're glad to be open sourcing this library. We use it in numerous places within the slack app and expect it to be easy to use as well as modify; we've added extensive documentation within the code to support that.

We will only be fixing critical bugs, thus, for any non-critical issues or feature requests we hope to be able to rely on the community using the library to add what they need. For more information, please read the contributing guidelines.


Stephen SowoleTosin Afolabi


PanModal is released under a MIT License. See LICENSE file for details.

You can’t perform that action at this time.