0

I have an ASNetworkImageNode inside an ASCellNode, the problem is that when I call tableNode.reloadData() this cause flickering in imageNode, if I change imageNode with flat ASDisplayNode, no flickering is showed. How can I fix this? this is the code of image node:

/// Image avatar
public lazy var avatar : ASNetworkImageNode = {
    let avt : ASNetworkImageNode    = ASNetworkImageNode()
    avt.style.preferredSize         = CGSize(width: 70, height: 70)
    avt.style.maxSize               = CGSize(width: 70, height: 70)
    avt.cornerRadius                = 35
    avt.clipsToBounds               = true
    avt.contentMode                 = .scaleAspectFill
    avt.defaultImage                = UIImage(named: "avatar")
    avt.shouldRenderProgressImages  = true
    return avt

}()

I tried by omitting default image, but I have the same problem!

Thanks!

Luca Becchetti
  • 1,210
  • 1
  • 12
  • 28
  • Where do you set the url? – Dog Jan 11 '18 at 18:31
  • in the init method – Luca Becchetti Jan 12 '18 at 08:57
  • @WonderDog init method – Luca Becchetti Jan 12 '18 at 14:28
  • I think its related to recall image data for each cell, and its work async so we can see that effect. But I use only once thats method, for start load layout data. Why do you call that method? And you can try play with `placeholderColor` mqybe its help for you. – Bimawa Jan 15 '18 at 07:37
  • @Bimawa i have a chat list of my chat, new I receive a new message, I need to move for example, the third cell to top of table view, so I have to reload my data – Luca Becchetti Jan 15 '18 at 10:41
  • 1
    @LucaBecchetti so for that feature you must use `performBatchAnimated:updates:completion:` for performs the relevant insert, delete, reload, or move operations. We are mobile, `reloadData`- is very expencive for us. Use it only if you want get flickering effect ;) – Bimawa Jan 15 '18 at 15:47

0 Answers0