iOS 15 Simulator - collection view cells rendering broken when scrolling...?

Viewed 700

I'm running my App on latest Xcode 13, running my app on iOS 15 in the simulator creates weird rendering bug / issue, when scrolling table rows (that contain collection views) horizontally. This is only visual. Touch points on cells are all ok, and I can scroll with my finger where the rendering doesn't...

scrolling horizontally breaks rendering

This is a table of collection views...

Also if I scroll the table vertically any rendering glitches are resolved...until I scroll left to right again.

1 Answers

I had almost related UI issues after updating to new Xcode 13. After reviewing my autoLayout code I found out that I was adding subViews as children of a collectionViewCell rather than it's contentView, as a side note this used to work on Xcode 12.x and lower.

So to fix the bug, all I had to do was: -

// instead of doing this: - 
self.addSubView(YourChildView)

// It should be: - 
self.contentView.addSubView(YourChildView)

// Then proceed with other layout stuffs
Related