一个使用圆形动画呈现 SwiftUI 视图的软件包。
您可以通过转到项目设置 > Swift Packages 并提供 GitHub URL 来添加此仓库,以此安装 CircularReveal
。或者,您可以转到 文件 > Swift Packages > 添加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
}
}
}
}
有关更多示例,请查看 Examples 文件夹
我非常感谢并欢迎您提供的任何问题报告、功能请求、pull request 或 GitHub star。
CircularReveal 基于 MIT 许可证发布。