集合视图滚动时,如何在集合视图上实现固定?在iOS中

时间:2018-09-06 18:15:01

标签: ios

我想在collectionview中实现钉书钉,并在最后一项的下方提供一个刷新视图,如何在Swift 4中实现这一目标?

1 个答案:

答案 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)
    }
}