圆形展开 (CircularReveal)

ios swiftui spm license

一个使用圆形动画呈现 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 许可证发布。

Buy Me A Coffee