Displays a customizable quick action card.
Please feel free to use this View in any of your projects!
Feedback form: https://forms.gle/h21HJ4yxiAg7HaYK8
Update 11.11.2019
new overlayUIScreen modifier
new cardPadding modifier
struct ContentView: View {
@State private var quickActionShown: Bool = false
var body: some View {
ZStack {
Button("Show Card") {
withAnimation {
self.quickActionShown.toggle()
}
}
if quickActionShown {
CardView(isPresented: $quickActionShown) {
// Your view to display in the card
VStack {
Text("Hello World!")
.font(.largeTitle)
HStack {
Text("Feel Free to use this. ")
Text("Anywhere...")
}
Text("๐ง")
.font(.largeTitle)
}
}
// Modifiers
.cardCornerRadius(20)
.enableHapticFeedback()
.dismissButton()
}
}
}
}
- overlayUIScreen
- enableHapticFeedback
- tapToDismiss
- dismissButton
- cardCornerRadius
- cardPadding
The card appears with a slide in from bottom transition.
The UIScreen overlay appears with an opacity transition (if you use the overlayUIScreen modifier).
You can reach me here:
[email protected]