1

I have a horizontal collection view inside tableview

In each collection view there are no of images loading from url with kingfisher library

but when i scroll fast ,tableview freeze for some seconds & scrolling continue after display cells images loading completed

I'm using UICollectionViewCell xib for cell reuse

self.imgPhoto.kf.setImage(with: URL(string: varImageURL))
Dharini
  • 700
  • 7
  • 20
  • **It's happening due to server image loading, use this.** https://stackoverflow.com/a/51746517/10150796 – Nikunj Kumbhani Aug 11 '18 at 05:59
  • I try your code but after some scrolling xcode gives following error - Message from debugger: Terminated due to memory issue – Dharini Aug 11 '18 at 06:14
  • Try to load image code in DispatchQueue.main.async { Here is your image load code } and check it – Nikunj Kumbhani Aug 11 '18 at 06:19
  • still freeze & slow down api call – Dharini Aug 11 '18 at 06:30
  • Please Display your Collectionview cellForRowAtIndexPath Code for More Information. – Nikunj Kumbhani Aug 11 '18 at 06:49
  • let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ImageSmallCollectionViewCell", for: indexPath as IndexPath) as! ImageSmallCollectionViewCell DispatchQueue.main.async { NKPlaceholderImage(image: UIImage(named: “ic_default.png”), imageView: cell.imgPhoto, imgUrl: varUrl) { (image) in } } – Dharini Aug 11 '18 at 07:07
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/177850/discussion-between-nikunj-kumbhani-and-dharini). – Nikunj Kumbhani Aug 11 '18 at 07:08

0 Answers0