Breaking One Big Graphic of MutablePaths into CAShapeLayers
Posted
by
StackOverFlowRider
on Stack Overflow
See other posts from Stack Overflow
or by StackOverFlowRider
Published on 2012-11-09T16:57:53Z
Indexed on
2012/11/09
16:59 UTC
Read the original article
Hit count: 176
I have a class called GraphicView
that takes a Graphic
object and draws it in its drawRect
method. This Graphic object is basically an array of mutablePaths
that comprise an icon that I want drawn. For performance and other issues, I was thinking of taking this icon that is comprised of mutablePaths
, and dividing it into a bunch of CAShapeLayers
.
I'm wondering is this possible? Considering the points for the mutablePaths
of the icon are all interwoven together (ie the icon was initially an SVG file that I converted to code), is it possible to divide different parts of the icon into CAShapeLayers
, and reassemble them all together when assigning to the views
layer
? If so how would it be done? If I assign them as sublayers to a CALayer or CAShapeLayer, will it understand to mesh them all together?
© Stack Overflow or respective owner