How to draw UIBezierPath with different colors?

Reposting for better tags. Please see the details for the original post: https://developer.apple.com/forums/thread/688268

I tried to pair the CATransaction.begin() and CATransaction.commit() but it does not work. Maybe I am doing it wrong.

Answered by ForumsContributor in
Accepted Answer

A CAShapeLayer displays a single CGPathRef with all of the properties that are assigned to it (such as the fillColor). If you want multiple colors, you will need to use multiple CAShapeLayers.

How to draw UIBezierPath with different colors?
 
 
Q