瀑布流网格

SwiftUI 瀑布流网格布局,支持懒加载

特性

Item 重新排序 自定义滚动分页和过渡效果

安装

可以使用 Swift Package Manager 安装 WaterfallGrids

  1. 在 Xcode 中打开 File/Swift Packages/Add Package Dependency... 菜单。

  2. 复制并粘贴包 URL

https://github.com/ricocrescenzio95/WaterfallGrids

更多详情请参考 Adding Package Dependencies to Your App 文档。

用法

通常,WaterfallGridLazyWaterfallGrid API 与其他 SwiftUI 视图(如 LazyVGridForEach)非常相似;这两个视图具有相同的初始化器,可以轻松地在 eager 和 lazy 版本之间切换。

WaterfallGrid(
	items: .columns([.init(), .init(alignment: .trailing, spacing: 10)]),
	spacing: 20,
	data: [0, 1, 2, 3, 4, 5, 6, 8, 9, 10],
	id: \.self
) { item in
	ItemView(item: item)
}

有关高级用法,请参考完整文档。

文档

使用 Apple DocC 生成的文档,从 Xcode 中,选择 Product > Build Documentation

发现 Bug 或想要新功能?

如果您发现 Bug,可以在 这里 提交 Bug issue

想要新功能?在 这里 提交 issue

您也可以提交自己的 PR 并为项目做贡献!贡献 🤝

许可证

本软件根据 MIT 许可证提供