Available in iOS14+, add refreshable for view (using in a million-user APP)
可在iOS14+版本使用的给视图添加刷新样式(已在百万用户的项目中使用)
block style
PPList(isRefreshing: $viewModel.model.isRefershing) {
content
} refreshAction: { completion in
refreshFunction(completion)
}
async style
PPList(isRefreshing: $viewModel.model.isRefershing) {
content
} asyncRefreshAction: {
await asyncRefreshFuction()
}
Any other views want to refreshable?
LazyVGrid(columns: itemLayouts, spacing: 0) {
content
}.pp_refreshable($viewModel.model.isRefershing) { completion in
refreshFunction(completion)
}
You can modify the animation and other features in the projects