1

The scrolling on my UICollectionView is really choppy. As I scroll past half the screen, it gets stuck for a moment and then proceeds. How can I make the scrolling more smooth using SWIFT?

bkmoney
  • 1,256
  • 1
  • 11
  • 19
shaydawg
  • 1,193
  • 1
  • 12
  • 17

3 Answers3

1

Use Time Profiler instrument to find out where the bottleneck is. Swift has nothing to do with scroll view's performance.

Khanh Nguyen
  • 11,112
  • 10
  • 52
  • 65
0

There are two complementary ways:

1) [Fast way] When choppy effect is large enough for giving you time for pressing pause button on the debugger. And then review what is doing main thread (Thread 1), most probably won't be doing UI tasks. Move those task to background.

2) When doesn't use instruments with core image.

0

This one help for you put this code after dequeueReusable Cell

cell.layer.shouldRasterize = YES;

cell.layer.rasterizationScale = [UIScreen mainScreen].scale;
Ishwar Hingu
  • 562
  • 7
  • 14