Skip to content

Commit 1c02adf

Browse files
committed
Update README
1 parent 1870921 commit 1c02adf

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Bottom Sheet component is designed to handle any content, including a scrolling
77
- ✅ build flows inside using `BottomSheetNavigationController`
88
- ✅ supports all system transitions: push and (interactive) pop
99
- ✅ transition animated between different content sizes
10+
- ✅ Customize appearance:
11+
- pull bar visibility
12+
- corner radius
13+
- shadow background color
1014

1115
## How it looks like
1216

@@ -28,16 +32,36 @@ To integrate Bottom Sheet into your Xcode project using Swift Package Manager, a
2832

2933
```swift
3034
dependencies: [
31-
.package(url: "https://github.com/joomcode/BottomSheet", from: "1.0.0")
35+
.package(url: "https://github.com/joomcode/BottomSheet", from: "2.0.0")
3236
]
3337
```
3438

3539
## Getting started
3640

3741
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`
42+
1. Create `UIViewController` to present and set content's size by [preferredContentSize](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621476-preferredcontentsize) property
43+
2. (optional) Conform to [ScrollableBottomSheetPresentedController](https://github.com/joomcode/BottomSheet/blob/81b0e2a7d405311b8456649452a8c49098490033/Sources/BottomSheet/Core/Presentation/BottomSheetPresentationController.swift#L12-L14) if your view controller is list-based
44+
3. Present by using [presentBottomSheet(viewController:configuration:)](https://github.com/joomcode/BottomSheet/blob/1870921364ed2cd68d51d7e7837e16e692278ff5/Sources/BottomSheet/Core/Extensions/UIViewController%2BConvenience.swift#L79)
45+
46+
If you want to build flows, use `BottomSheetNavigationController`
47+
```Swift
48+
presentBottomSheetInsideNavigationController(
49+
viewController: viewControllerToPresent,
50+
configuration: .default
51+
)
52+
```
53+
54+
You can customize appearance passing configuration parameter
55+
```Swift
56+
presentBottomSheet(
57+
viewController: viewControllerToPresent,
58+
configuration: BottomSheetConfiguration(
59+
cornerRadius: 10,
60+
pullBarConfiguration: .visible(.init(height: 20)),
61+
shadowConfiguration: .init(backgroundColor: UIColor.black.withAlphaComponent(0.6))
62+
)
63+
)
64+
```
4165

4266
## Resources
4367

0 commit comments

Comments
 (0)