Swiftpack.co - tyagishi/SDSPartialModalView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by tyagishi.
tyagishi/SDSPartialModalView 1.0.1
partial modal
⭐️ 1
🕓 2 years ago
iOS macOS
.package(url: "https://github.com/tyagishi/SDSPartialModalView.git", from: "1.0.1")

SDSPartialModalView

macOS iOS iOS macOS SPM is supported license

simple partial modal view

in 30sec

light mode

https://user-images.githubusercontent.com/6419800/159105246-424e3fa8-b6a7-46a2-9499-351e0f245eaf.mp4

dark mode

https://user-images.githubusercontent.com/6419800/159105241-3200b3ef-d6c3-4ddc-9873-15db9a288ed8.mp4

usage

need to use together with ZStack.

//
//  ContentView.swift
//
//  Created by : Tomoaki Yagishita on 2022/03/10
//  © 2022  SmallDeskSoftware
//

import SwiftUI
import SDSPartialModalView

struct ContentView: View {
    @State private var showPartial = false
    @State private var fieldValue = "Hello"

    var body: some View {
        ZStack {
            VStack {
                Button(action: {
                    withAnimation {
                        showPartial.toggle()
                    }
                }, label: {
                    Text("partial modal")
                })
            }
            PartialModalView(isPresenting: $showPartial, content: {
                VStack {
                    Text("Hello")
                    TextField("Text", text: $fieldValue)
                        .textFieldStyle(.roundedBorder)
                }
                .padding()
            })
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

GitHub

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

Release Notes

1.0.1
2 years ago

fix bug: before proceeding close process, check isPresenting

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