Performance of the new NSCollectionView with layer-backing

Hi,


In session 225 of WWDC 2015, the speaker said:


"Like everything else on iOS, UICollectionView was designed from the beginning to always operate layer-backed, which gives it the ability to present very fluid, high-frame-rate animation, as the items in the Collection View move around, and come and go, it can give you have a very nice, animated effect."


and


"I said that the new CollectionView is designed to run layer-backs, we're going to go over here to our inspector, and we'll set the [indecipherable] property on the scroll view to ensure layer-backing."


However, I created a very simple NSCollectionView that just shows an image and a label for each collection view item.

If I don't use layer-backing on the scrollview, scrolling is very smooth, but as soon as I use layer-backing on the scrollview, scrolling is no longer smooth and collection view items don't always appear immediately when scrolling quickly.


I then tried to reproduce this issue with the sample code of the session and obtained the same results. With a large folder of images, collection views items don't always appear immediately when scrolling quickly. However, if I remove layer-backing on the scrollview, they appear immediately when scrolling.


Shouldn't it be the opposite?

Replies

Hello Romain,


I haven't tried without layer-backing but I can confirm that, using a layer-backed NSCollectionView with embedded NSImageViews, scrolling is not very smooth. I have solved this issue using a CALayer to display my images and I have ditched NSImageView altogether. Scrolling is now very smooth.


Hope this helps.


Andrea