Skip to content

CircularReveal is a SwiftUI modifier that allows presenting views with a circular animation

License

Notifications You must be signed in to change notification settings

terlan98/CircularReveal

Repository files navigation

CircularReveal

ios swiftui spm license

A SwiftUI package for presenting views with a circular animation.

📦 Features

  • Trigger with a boolean or an arbitrary item
  • Set custom animation duration
  • Execute a closure when the presented view is dismissed

🛠 Installation

You can install CircularReveal by going to your Project settings > Swift Packages and add the repository by providing the GitHub URL. Alternatively, you can go to File > Swift Packages > Add Package Dependencies...

🚀 Usage

Example

struct FirstView: View {
    @State private var isRevealed = false

    var body: some View {
        VStack {
            Text("This is the first view")

            Button("Present Second View") {
                isRevealed = true
            }
        }
        .circularReveal(isRevealed: $isRevealed) {
            SecondView(isRevealed: $isRevealed)
        }
    }
}
struct SecondView: View {
    @Binding var isRevealed: Bool

    var body: some View {
        VStack {
            Text("This is the second view")
  
            Button("Dismiss Second View") {
                isRevealed = false
            }
        }
    }
}

For more examples, check out the Examples folder

🤝 Contribution

I highly appreciate and welcome any issue reports, feature requests, pull requests, or GitHub stars you may provide.

License

CircularReveal is released under the MIT license.

Buy Me A Coffee