Swiftpack.co - shirokova/bottomsheet-swiftui as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by shirokova.
shirokova/bottomsheet-swiftui 1.0.0
BottomSheet view in SwiftUI
⭐️ 5
🕓 3 years ago
iOS
.package(url: "https://github.com/shirokova/bottomsheet-swiftui.git", from: "1.0.0")

BottomSheet-SwiftUI

BottomSheet view in SwiftUI

Based on: https://gist.github.com/mecid/78eab34d05498d6c60ae0f162bfd81ee

Usage

import SwiftUI
import BottomSheet_SwiftUI

struct ContentView: View {
    @State private var bottomSheetOpened = false
    var body: some View {
        GeometryReader { geometry in
            Color.green
                .edgesIgnoringSafeArea(.all)
            BottomSheet(
                isOpen: self.$bottomSheetOpened,
                config: BottomSheetConfig(maxHeight: geometry.size.height * 0.9)
            ) {
                Color.white
            }
        }.edgesIgnoringSafeArea(.all)
    }
}

Default config values

minHeightRatio: 0.2,
maxHeight: 300,
radius: 20,
indicatorSize: width: 100, height: 5,
snapRatio: 0.1,
indicatorColor: black,
indicatorBackgroundColor: white

Installation

Swift Package Manager

BottomSheet-SwiftUI is SwiftPM-compatible. To install, add this package to your Package.swift or your Xcode project.

GitHub

link
Stars: 5
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics