Skip to content

Leon12345679/QuickActionCard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

QuickActionCard

Displays a customizable quick action card.
Please feel free to use this View in any of your projects!

Feedback form: https://forms.gle/h21HJ4yxiAg7HaYK8


darkMode withOverlay

Updates

Update 11.11.2019
new overlayUIScreen modifier
new cardPadding modifier

Usage Example

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()
            }
        }
    }
}

Current Modifiers

  • overlayUIScreen
  • enableHapticFeedback
  • tapToDismiss
  • dismissButton
  • cardCornerRadius
  • cardPadding

Default Behavior

The card appears with a slide in from bottom transition.
The UIScreen overlay appears with an opacity transition (if you use the overlayUIScreen modifier).

Contact Info

You can reach me here:
Leon.Vladimirov@gmail.com