simple partial modal view
https://user-images.githubusercontent.com/6419800/159105246-424e3fa8-b6a7-46a2-9499-351e0f245eaf.mp4
https://user-images.githubusercontent.com/6419800/159105241-3200b3ef-d6c3-4ddc-9873-15db9a288ed8.mp4
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()
}
}
link |
Stars: 1 |
Last commit: 1 year ago |
fix bug: before proceeding close process, check isPresenting
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics