Skip to content

Commit

Permalink
Update Usage in README
Browse files Browse the repository at this point in the history
  • Loading branch information
weitieda committed Apr 30, 2020
1 parent 4ded9c5 commit b3a6d54
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@
iOS 13

## Usage
Simply wrap `BottomSheet` in `ZStack`

```swift
@State var isPresented = true

ZStack {
Text("Hi")
BottomSheet(isPresented: $isPresented, maxHeight: 300) {
List(0..<20) { Text("\($0)") }
NavigationView {
List(0..<20) {
Text("\($0)")
}
.bottomSheet(isPresented: self.$isPresented, maxHeight: 300) {
List(20..<40) { Text("\($0)") }
}
.navigationBarTitle("Bottom Sheet")
.navigationBarItems(
trailing: Button(action: { self.isPresented = true }) { Text("Show") }
)
}
```
You can also set `topBarBackgroundColor` and `contentBackgroundColor` in `initializer` as you want.
Expand Down

0 comments on commit b3a6d54

Please sign in to comment.