aaronpearce / bottom-sheet

⬆️ A SwiftUI view component sliding in from bottom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SwiftUI BottomSheet

GitHub tag (latest SemVer) License

preview preview

Requirements

iOS 13

Usage

Same way as you use Sheet in SwiftUI

NavigationView {
    List(0..<20) {
        Text("\($0)")
    }
    .bottomSheet(isPresented: self.$isPresented, height: 300) {
        List(20..<40) { Text("\($0)") }
    }
    .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

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.

Author

Tieda Wei

License

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

About

⬆️ A SwiftUI view component sliding in from bottom

License:MIT License


Languages

Language:Swift 95.4%Language:Ruby 4.6%