복붙노트

[SWIFT] UICollectionView는 API 작업과 매김

SWIFT

UICollectionView는 API 작업과 매김

해결법


  1. 1.이 코드를 시도하십시오.

    이 코드를 시도하십시오.

      func scrollViewDidScroll(_ scrollView: UIScrollView) {
       if isGetResponse {
        if (scrollView.contentOffset.y == scrollView.contentSize.height - scrollView.frame.size.height)
        {
            if totalArrayCount! > self.arrImage.count{
    
                    isGetResponse = false
                    activityIndiator?.startAnimating()
                    self.view.bringSubview(toFront: activityIndiator!)
                    pageIndex = pageIndex + 1
                    print(pageIndex)
                    self.getProductListing(withPageCount: pageIndex)
                }
            }
    
            //LOAD MORE
            // you can also add a isLoading bool value for better dealing :D
        }
    }
    
  2. from https://stackoverflow.com/questions/53360597/pagination-with-uicollectionview-working-with-api by cc-by-sa and MIT license