I have a bunch of identical CALayers that I want to reuse. Often, some of them must disappear, and then use them again in a different position within the same super layer (half a second later).
What is the best way (in terms of performance) to keep them until they disappear from the screen? setHidden: YES or setOpacity: 0 or removeFromSuperLayer? Or something else I don’t think about?
(There are about 12 identical round CALayers with content from UIImage and about 30 CAShapeLayers, each of which has only a line segment, although usually in different orientations -)
baris source
share