A SwiftUI package for presenting views with a circular animation.
- Trigger with a boolean or an arbitrary item
- Set custom animation duration
- Execute a closure when the presented view is dismissed
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...
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
I highly appreciate and welcome any issue reports, feature requests, pull requests, or GitHub stars you may provide.
CircularReveal is released under the MIT license.