Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weitieda/bottom-sheet
⬆️ A SwiftUI view component sliding in from bottom
https://github.com/weitieda/bottom-sheet
animation card drag ios sheet swift swiftpackage swiftpackagemanager swiftui
Last synced: about 1 month ago
JSON representation
⬆️ A SwiftUI view component sliding in from bottom
- Host: GitHub
- URL: https://github.com/weitieda/bottom-sheet
- Owner: weitieda
- License: mit
- Created: 2020-04-26T18:28:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-14T02:14:42.000Z (about 2 years ago)
- Last Synced: 2024-08-03T18:13:35.803Z (5 months ago)
- Topics: animation, card, drag, ios, sheet, swift, swiftpackage, swiftpackagemanager, swiftui
- Language: Swift
- Homepage:
- Size: 4.03 MB
- Stars: 816
- Watchers: 6
- Forks: 54
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swiftui-libraries - BottomSheet - A SwiftUI view component sliding in from bottom (Sheet / Content)
README
![SwiftUI BottomSheet](Asset/logo.png)
![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/weitieda/BottomSheet)
[![License](https://img.shields.io/github/license/weitieda/BottomSheet)](LICENSE)![preview](Asset/demo1.gif)
![preview](Asset/demo2.gif)## Usage
Same way as you use `Sheet` in `SwiftUI`
```swift
NavigationView {
List(0..<20) {
Text("\($0)")
}.listStyle(PlainListStyle())
.bottomSheet(isPresented: $isPresented, height: 300) {
List(20..<40) { Text("\($0)") }.listStyle(PlainListStyle())
}
.navigationBarTitle("Bottom Sheet")
.navigationBarItems(
trailing: Button(action: { self.isPresented = true }) {
Text("Show")
}
)
}
```## Example
> Both demo preview code are available in example project.
To run the example project, clone this repo, and open iOS Example.xcworkspace from the iOS Example directory.
## Installation
>📱 iOS 13.0+
#### Swift Package Manager
To install `BottomSheet` using [Swift Package Manager](https://swift.org/package-manager/), add
`.package(name: "BottomSheet", url: "https://github.com/weitieda/bottom-sheet", from: "1.0.0"),"` to your Package.swift, then follow the integration tutorial [here](https://swift.org/package-manager#importing-dependencies).#### CocoaPods
To install `BottomSheet` using [CocoaPods](http://cocoapods.org), add
`pod 'BottomSheet', :git => 'https://github.com/weitieda/bottom-sheet.git'` to your Podfile, then follow the integration tutorial [here](https://guides.cocoapods.org/using/using-cocoapods.html).## License
BottomSheet is available under the MIT license. See [the LICENSE file](LICENSE) for more information.