title: UICollectionView Custom layout reloading issue in Swift
body: <p>This is refrence link:</p>
  
  <p><a href="https://www.raywenderlich.com/107439/uicollectionview-custom-layout-tutorial-pinterest" rel="nofollow">https://www.raywenderlich.com/107439/uicollectionview-custom-layout-tutorial-pinterest</a></p>
  
  <p>I have implemented load more in <code>UICollectionView</code> at last cell , the data is getting downloaded, after download complete i want to reload collection </p>
  
  <pre><code>collectionView.collectionViewLayout.invalidateLayout()
  self.collectionView.reloadData()
  
  let concurrentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
  dispatch_async(concurrentQueue) {
              DataManager.sharedInstance.homeRequest(Dictionary: params, onSuccess: { (dict) in
                  self.downloadPageIndex +=  1
                  let response = HomeObject(dictionary: dict)
  
                  for (_,e) in (response.dataDict?.enumerate())!{
                      self.dataArray.append(e)
                  }
  
                  dispatch_async(dispatch_get_main_queue()) {
  
                      self.collectionView.reloadData()
                      self.collectionView.collectionViewLayout.invalidateLayout()
  
                  }
                  self.activityIndicatorCell.stopAnimating()
  
                  }, onError: { (error) in
                      self.activityIndicatorCell.stopAnimating()
  
              })
  </code></pre>
  
  <p>like this  collectionview reloadata</p>
  
  <p>Can any one help me out?</p>