I have a working application where I am using Alamofire
and SwiftyJSON
to fetch images from flicr API. Now, I want to include pagination in the ret
Please try this code.
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
}
}