import SwiftUI
import SwiftUIOverlayContainer
struct ContainerConfiguration: ContainerConfigurationProtocol {
var displayType: ContainerViewDisplayType = .vertical
var queueType: ContainerViewQueueType = .oneByOneWaitFinish
var ignoresSafeArea: ContainerIgnoresSafeArea = .all
var alignment: Alignment = .bottom
var tapToDismiss: Bool = false
var backgroundStyle: ContainerBackgroundStyle = .blur(.regular)
var shadowStyle: ContainerViewShadowStyle = .radius(12)
var dismissGesture: ContainerViewDismissGesture = .disable
var autoDismiss: ContainerViewAutoDismiss = .disable
}
struct ContainerViewConfiguration: ContainerViewConfigurationProtocol {
}
struct ContentView: View {
@State var text: String = "Test"
@State var isPresented: Bool = false
var body: some View {
Text("Hello, world!")
.padding()
.overlayContainer("clone", containerConfiguration: ContainerConfiguration())
.containerView(
in: "clone",
configuration: ContainerViewConfiguration(),
isPresented: $isPresented,
content:
VStack {
Button {
text = UUID().uuidString
} label: {
Text("Change Text")
}
Text(text)
.background(.red)
.padding()
}
)
Button {
isPresented = true
} label: {
Text("Show")
}
}
}