Skip to content

vivalalova/SheetOver

Repository files navigation

SheetOver

Feature

  • Customable Bottom sheet

image

Uasge

// current position
@State var position: SheetOver.Position = .short()
// stop position when dragging stopped
@State var allowed: [SheetOver.Position] = [.tall(scrollable: true), .half(), .short()]
SomeView()
  .sheetOver($model.position, allowed: $model.allowed) {
    VStack(spacing: 0) {
      Text("title").font(.title)

      Divider()

      LazyVStack {
        ForEach(1 ..< 55) { _ in
          Text("hihi")
            .font(.largeTitle)
        }
      }
      // scroll at .tall because .tall(scrollable: true) at allowed
      // or just false for long contentSize.height
      .sheetOverScrollable()
    }
    .padding(.top, 20)
    .sheetOverTopBarColor(.red)
    .sheetOverBackgroundColor(.blue)
  }

About

Customable bottom sheet in SwiftUI

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages