MKTView `draw()` not updating when user scrolling its containing view

Hi there,

I’m having some trouble implementing MKTView on my own app. The view hierarchy is:

- UICollectionView
+--- UICollectionViewCell
     +--- MKTView

The draw() calls made on the MKTView views are OK — they update the view’s content regularly as new drawables become available.

But when the user is scrolling the UICollectionView, the updates are halted until the collection view stops scrolling. I’m trying all keywords combinations and couldn’t find a solution.

So far I’ve tried:

  • Calling draw() on the main thread but didn’t work — and I shouldn’t be doing this to begin with according to documentation.
  • Implement UIScrollViewDelegate and try redrawing in scrollViewDidScroll(_:). I cannot update the content but can update view layer opacity this way…

It seems that when the user scrolls the collection view, the thread for rendering is blocked until the scrolling stops. Any pointer would be greatly appreciated!

Thanks,
Teng

Hi Teng and welcome to the forums!

Do you have any code that you can share? This isn’t something I’ve done before.