title: CollectionView cell reuse
body: <p>I am using collection View and loading more data through API call. When I am loading more data from API, collectionView showing activity indicator at bottom but unable to add more collectionView cell just updating the existing cells only.</p>
  
  <p>Any help will be appreciated.</p>
  
  <p>For reference </p>
  
  <pre><code>// MARK: Delegates
  extension ProdSubCat: UICollectionViewDelegateFlowLayout {
  
      func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
          if indexPath.row == subCatArr.count - 1 &amp;&amp; !self.isLoading {
              loadMoreData()
          }
      }
  
  For load more data
  ======================
  
  func loadMoreData() {
  
          if !self.isLoading {
              self.isLoading = true
              DispatchQueue.global().async {
                  // Fake background loading task for 2 seconds
                  sleep(2)
                  // Download more data here
                  self.productSubCategories(offset: self.offsetValue, limit: 25)
                  DispatchQueue.main.async {
                      self.collectionView.reloadData()
                      self.isLoading = false
                  }
              }
          }
      }
  
   API CALL Method:
  ======================
   // MARK: API
      func productSubCategories(offset: Int, limit: Int) {
  
  
  if response.response?.statusCode == 200 {
                      let swiftyJsonVar = JSON(response.result.value!)
                      print(swiftyJsonVar["message"].string ?? "")
                      if let category = swiftyJsonVar["product"].arrayObject {
                          if category.count != 0 {
                              self.subCatArr = category as! [[String : Any]]
                          } else {
                              self.isLoading = true
                          }
                      }
                      self.offsetValue = self.offsetValue + limit
                      print(self.offsetValue)
                      self.collectionView.reloadData()
                  } else {
                      print("\(String(describing: response.request))")
                      print("Error")
                  }
                  ProgressHUD.dismiss()
              }
          } else {
              self.alertMessage(title: "Connectivity Error!", message: "Please connect to internet")
              ProgressHUD.dismiss()
          }
      }
  </code></pre>