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?
Asked
Active
Viewed 1,194 times
1
-
can you show you "cellForItemAtIndexPath" method ? – Mo Farhand Sep 06 '15 at 07:31
3 Answers
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.

Javier Calatrava Llavería
- 9,493
- 4
- 53
- 47
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