项目作者: weitieda

项目描述 :
⬆️ A SwiftUI view component sliding in from bottom
高级语言: Swift
项目地址: git://github.com/weitieda/bottom-sheet.git
创建时间: 2020-04-26T18:28:54Z
项目社区:https://github.com/weitieda/bottom-sheet

开源协议:MIT License

下载


SwiftUI BottomSheet

GitHub tag (latest SemVer)
License

preview
preview

Usage

Same way as you use Sheet in SwiftUI

  1. NavigationView {
  2. List(0..<20) {
  3. Text("\($0)")
  4. }.listStyle(PlainListStyle())
  5. .bottomSheet(isPresented: $isPresented, height: 300) {
  6. List(20..<40) { Text("\($0)") }.listStyle(PlainListStyle())
  7. }
  8. .navigationBarTitle("Bottom Sheet")
  9. .navigationBarItems(
  10. trailing: Button(action: { self.isPresented = true }) {
  11. Text("Show")
  12. }
  13. )
  14. }

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, 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.

CocoaPods

To install BottomSheet using CocoaPods, add
pod 'BottomSheet', :git => 'https://github.com/weitieda/bottom-sheet.git' to your Podfile, then follow the integration tutorial here.

License

BottomSheet is available under the MIT license. See the LICENSE file for more information.