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.

Replies

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.

  • Must I use multiple CAShapeLayers? How about using one CAShapeLayers? and multiple BezierPath?

Add a Comment