Skip to content

rusik/BottomSheet

 
 

Repository files navigation

Bottom Sheet

Bottom Sheet component is designed to handle any content, including a scrolling one.

  • ✅ use any content size, and it will adapt
  • ✅ use scrollable content: UICollectionView, UITableView or UIScrollView
  • ✅ dismiss interactively by swipe-down or just tapping on an empty space
  • ✅ build flows inside using BottomSheetNavigationController
    • ✅ supports all system transitions: push and (interactive) pop
    • ✅ transition animated between different content sizes

How it looks like

Adapts to content size Interactive dismissal
adapt-to-content-size interactive-dismissal

NavigationController inside Bottom Sheet

Push and pop transitions Interactive pop transition
system-push-pop interactive-pop

Installation

Swift Package Manager

To integrate Bottom Sheet into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift:

dependencies: [
    .package(url: "https://github.com/joomcode/BottomSheet", from: "1.0.0")
]

Getting started

This repo contains demo, which can be a great start for understanding Bottom Sheet usage, but here are simple steps to follow:

  1. Set content's size using preferredContentSize
  2. (optional) Conform to ScrollableBottomSheetPresentedController if your view controller is list-based
  3. Present using custom transition BottomSheetTransitioningDelegate

Resources

Read the article on Medium for betting understanding of how it works under the hood

Releases

No releases published

Packages

No packages published

Languages

  • Swift 89.9%
  • Objective-C 10.1%