I have a view with a CATiledLayer backing. I want to take the visible tiles from this CATiledLayer UIView and add it to another view as its CALayer backing, thus recreating the visible image in another UIView that doesnt use CATiledLayer.
The reason I want to do this is I will use this second UIView to mask the effect of updating the CATiledLayer backed UIView - this currently produces a flicker as all tiles are re-loaded.
The problem is, I'm not totally sure how i would do this. Any ideas?
CATiledLayer is a subclass of CALayer providing a way to asynchronously provide tiles of the layer's content, potentially cached at multiple levels of detail.
You can render the visible things in the layer into a CGContextRef with:
- (void)renderInContext:(CGContextRef)ctx
And then use this to update your other layer by settings its delegate and implementing the
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context
ss shown here http://www.raywenderlich.com/2502/introduction-to-calayers-tutorial
But honestly I don't think this is efficient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With