|
1 | 1 | # Bottom Sheet |
2 | 2 |
|
3 | | -Bottom Sheet component is widely used in Joom application |
| 3 | +Bottom Sheet component is designed to handle any content, including a scrolling one. |
| 4 | +- ✅ use any content size, and it will adapt |
| 5 | +- ✅ use scrollable content: `UICollectionView`, `UITableView` or `UIScrollView` |
| 6 | +- ✅ dismiss interactively by swipe-down or just tapping on an empty space |
| 7 | +- ✅ build flows inside using `BottomSheetNavigationController` |
| 8 | + - ✅ supports all system transitions: push and (interactive) pop |
| 9 | + - ✅ transition animated between different content sizes |
| 10 | + |
| 11 | +## How it looks like |
| 12 | + |
| 13 | +| Adapts to content size | Interactive dismissal | |
| 14 | +| - | - | |
| 15 | +|  |  | |
| 16 | + |
| 17 | +### NavigationController inside Bottom Sheet |
| 18 | + |
| 19 | +| Push and pop transitions | Interactive pop transition | |
| 20 | +| - | - | |
| 21 | +|  |  | |
4 | 22 |
|
5 | 23 | ## Installation |
6 | 24 |
|
7 | 25 | ### Swift Package Manager |
8 | 26 |
|
9 | | -[Swift Package Manager](https://swift.org/package-manager/) is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. |
10 | | - |
11 | 27 | To integrate Bottom Sheet into your Xcode project using Swift Package Manager, add it to the dependencies value of your `Package.swift`: |
12 | 28 |
|
13 | 29 | ```swift |
14 | 30 | dependencies: [ |
15 | | - .package(url: "https://github.com/SnapKit/SnapKit.git", .branch("main")) |
| 31 | + .package(url: "https://github.com/joomcode/BottomSheet", from: "1.0.0") |
16 | 32 | ] |
17 | 33 | ``` |
| 34 | + |
| 35 | +## Getting started |
| 36 | + |
| 37 | +This repo contains [demo](https://github.com/joomcode/BottomSheet/tree/main/BottomSheetDemo), which can be a great start for understanding Bottom Sheet usage, but here are simple steps to follow: |
| 38 | +1. Set content's size using [preferredContentSize](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621476-preferredcontentsize) |
| 39 | +2. (optional) Conform to `ScrollableBottomSheetPresentedController` if your view controller is list-based |
| 40 | +3. Present using custom transition `BottomSheetTransitioningDelegate` |
| 41 | + |
| 42 | +## Resources |
| 43 | + |
| 44 | +Read the [article on Medium](https://medium.com/me/stats/post/400515255829) for betting understanding of how it works under the hood |
0 commit comments