我想在collectionview中实现钉书钉,并在最后一项的下方提供一个刷新视图,如何在Swift 4中实现这一目标?
答案 0 :(得分:0)
我已将2个公共变量声明为:
var page_number = 1
var total_count = 0
然后“编辑”会将委托方法显示为:
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath)
{
if(indexPath.item == (arrayProperties.count - 1) && arrayProperties.count < total_count )
{
page_number = page_number+1
// Call api with updated page_number
callApi(pageNumber: page_number)
}
}