Pick the fix
A card with a shadow causes hitches while scrolling. Best fix?
Hint 1 of 1
What does the shadow need to know?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Set layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: 12).cgPath in layoutSubviews
Correct. With an explicit path, the shadow doesn't need an offscreen pass.
Why not the others?
- B Increase shadowRadius. A larger blur costs more.
- C Set shouldRasterize on every cell. It re-rasterizes when content changes, which can make things worse.
- D Turn on Color Blended Layers in release. It's a debug visualisation, not a fix.