Show a card-style action sheet that slides up from the bottom of your iOS screen.
Build a bottom panel users can expand, collapse, or dismiss by swiping, like Slack's own UI.
Display a settings or detail view as a half-screen overlay without navigating away from the current screen.
Add a scrollable bottom sheet where dragging the content list also collapses the sheet.
Requires iOS 10+ and Swift 4.2+, one line of code to present the first sheet.
PanModal is a Swift library from Slack that makes it easier to show bottom sheet modals in iOS apps. A bottom sheet is a panel that slides up from the bottom of the screen, letting users interact with content without leaving the current view. PanModal handles the gesture recognition, animation, and transition so developers do not have to build this from scratch. Getting started requires one line of code: call presentPanModal with the view controller you want to display. The view controller needs to adopt the PanModalPresentable protocol, which asks it to declare a panScrollable property. If the content includes a scrollable list such as a table view, pointing panScrollable at that scroll view lets PanModal coordinate pan gestures between the bottom sheet drag handle and the content inside it. Scrolling down when the sheet is expanded can collapse it, pulling up expands it again. Two height configurations are available: shortFormHeight for a compact position, and longFormHeight for the fully expanded state. Both can be set to fixed pixel values or configured to fill the screen with a top inset. If the height needs to change after the sheet is already visible, calling panModalSetNeedsLayoutUpdate tells the library to recalculate and animate to the new size. The library requires iOS 10 or later and is compatible with Swift 4.2 and 5. It can be installed through CocoaPods, Carthage, or Swift Package Manager. A sample app in the repository shows more involved setups including navigation controllers and stacked modals. PanModal was built by Slack for use in its own iOS application and is open sourced under the MIT license. The team notes they address only critical bugs, non-critical improvements are left to the community.
← slackhq on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.