0

I have noticed that the scrolling of the collectionView in my app is very 'choppy' when running on iOS9. I have taken away all items in the collectionView and left only a textView and nothing else and the scroll is still very choppy. There are no images or heavy assets in the collectionView cells. The scroll is smooth in iOS8. After researching I found a few threads recommending to add the following two lines of code in the cellForItemAtIndexPath function of the collectionView just prior to returning the cell:

cell.layer.shouldRasterize = true

cell.layer.rasterizationScale = UIScreen.mainScreen().scale

Adding this did not make any difference for me and the choppiness is still there. Has anybody else experienced this and found a solution? I have stripped down my collectionView to only containing a textView.

The only thing I can think of is whether the storyboard constraints are causing this behaviour. There is nothing at all unusual about my constraints. I have one constraint that is a less than or equals to but changing that did not help. Thanks.

alionthego
  • 8,508
  • 9
  • 52
  • 125
  • 1
    Are you sure the problem is with the collection view? Are you running any other processes on the UI thread that could be causing the stuttering? Have you tried running the app through instruments to get a better idea of what is going wrong? – Abizern Oct 25 '15 at 02:48
  • I don't think I am running any other stuff on the same thread. It's quite a simple chat app. As for instruments I have tried recently to use it to trouble shoot this but I'm not all that familiar with it. Regardless, the thing I don't understand is why it works smoothly on iOS8. I will explore instruments to see. Which particular instrument do you recommend? I have used core Animation Instrument to check the fps which is about 45 during scrolling. – alionthego Oct 25 '15 at 02:51
  • Sorry, I'm not very familiar with instruments. Is that the time profiler your referring to? – alionthego Oct 25 '15 at 02:54
  • i changed the textview to a label and the scrolling was smooth so the problem is definitely with having a textView in the collectionView. I need the textView for hyperlink detection though so I'm stuck... – alionthego Oct 26 '15 at 14:52

0 Answers0