Search code examples
iossprite-kitcore-animationthumbnailstvos

Displaying LOTS of thumbnails on iOS/tvOS?


To isolate the question I'm asking:

  • assume that I have local access to all the pre rendered thumbnails.
  • think: outermost view on the built-in Photos app.
  • the thumbnails may need to animate in some way(s)
  • doesn't need to scroll

The most obvious class is UICollectionView used as a grid view. But I'm wondering if SpriteKit would work, or possibly SceneKit. iOS is the primary target, but tvOS support would be awesome

I need it to be performant for the animations, obviously, which is why i'm considering SpriteKit at all.

It would be a monumental task for me to tackle the ins and outs of Metal and MetalKit, so I'm hoping someone out there has experience with putting approx 1500 images on a screen, animating them into place from off screen.


Solution

  • Core Animation and SpriteKit were both designed (quite explicitly in the case of Core Animation) to handle this sort of design idea.

    Perhaps not to the scale of 1500 screens, but Moore's Law is probably on your side. And the size of the images, too.

    Both of these frameworks can present short quicktime encoded movies, which alleviates much of the memory problem, and they can decode lots of them, on the fly, especially if they're of small dimensions. And this is going to be the case when you optimise for your view congested with 1500 "screens".

    But I'd suggest putting them together, in batches of 15 or 30 "screens", and doing hit testing to determine which one's been touched. Which is going to be hell for users... because:

    If the little movie screens are the same aspect as the presenting scene, then you'd have them at about 50 x 28 pixels in size. On an iPhone xPlus model, that's TINY!

    by way of example, here's 1500 units on a 1920x1080 image. Drop this on your iPhone Plus and see if you can touch just one of them...

    enter image description here