1

I'm making a sprite kit game and have a UITableView and UICollectionView within a view controller hovering over the game SKScene. I noticed that as the user starts to scroll the table or collection view, the FPS counter in xCode drops from 60 to 16, and there's visible lag in scrolling.

How can I find what is causing low FPS when scrolling a table view? Is there an instrument or a tutorial on how to improve animation responsiveness?

Trying the analyze function for OpenGL ES shows this message :

"Your performance is not limited by the OpenGL ES commands issued. use the instruments tool to investigate where your application is bottlenecked".

Alex Stone
  • 46,408
  • 55
  • 231
  • 407
  • If the scrolling performance is adequate for you as shown in the following video, let me know, and I'll post send you the code (it's incredibly simple): [Using a UICollectionView as a UIControl](https://youtu.be/Pkl2gg3LDdI) – James Bush Nov 16 '16 at 02:30

1 Answers1

1

This behavior is commonly observed when scrolling UIViews. Even with cocos2d it's one heck of a problem to get both working together smoothly. The problem is that while scrolling you now have two views who want to render at 60 fps on the same thread, eating up each other's CPU cycles.

You could pause the scene while scrolling, that should make the scrolling smooth. Other than that you're very limited in what you can do to resolve this with Sprite Kit as you can't modify the render loop.

Community
  • 1
  • 1
CodeSmile
  • 64,284
  • 20
  • 132
  • 217
  • Is there still no absolute solution to this? This is extremely frustrating as I'm using Collection and Table views all through the UI of my game and they lag pretty badly (especially if I add a lot of visual complexity to them). – datWooWoo Apr 14 '15 at 18:20