iOS - How to make the tableview use paginated API output?

前端 未结 2 1740
执笔经年
执笔经年 2020-12-04 15:46

An API I am writing has about 2000 records, returned in JSON via a simple RESTful API I have written.

To reduce issues with lots of data, I want to use pagination so

2条回答
  •  一整个雨季
    2020-12-04 16:46

    For Swift

    func scrollViewDidScroll(scrollView: UIScrollView) {
            if collectionViewGif.contentOffset.y >= self.collectionViewGif.contentSize.height - self.collectionViewGif.frame.size.height
            {
                offset = offset + 1
                self.fetchGifWithPaination(defaultText)
            }
        }
    

提交回复
热议问题