Swiftpack.co - bartleby/SheetDetentsModifier as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by bartleby.
bartleby/SheetDetentsModifier 1.0.1
This is a small View modifier that adds detents for native .sheet representations that appeared in iOS 16
⭐️ 21
🕓 1 year ago
iOS
.package(url: "https://github.com/bartleby/SheetDetentsModifier.git", from: "1.0.1")

SheetDetentsModifier

This is a small View modifier that adds detents for .sheet representations that appeared in iOS 16

It works starting with iOS 15 ⚠️

Install

SwiftPM

https://github.com/bartleby/SheetDetentsModifier.git

Examples

struct ContentView: View {
    @State var showSheet: Bool = false
    var body: some View {
        VStack {
            Button("Show") {
                showSheet.toggle()
            }
        }
        .sheet(isPresented: $showSheet) {
            VStack {
                Button("Hide") {
                    showSheet.toggle()
                }
            }
            .presentationDetents([.medium, .large])
            .ignoresSafeArea() // To remove the white strip on the iPhone 10+
        }
    }
}

Make a star ❤️‍🔥

GitHub

link
Stars: 21
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

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