I've been trying to figure out how to zoom a UIScrollView without using CATiledLayer. Almost every example I've found and Apple's documentation says you should use CATiledLayer since it handles the automatic zooming for you and you just need to draw your content like normal via the layer's delegate. If you don't use CATiledLayer you get simply a blurred image of your layer/view.
However if you try to add sublayers to CATiledLayer, you don't get the nice sharpened scaling automatically (CAShapeLayer does work though). The other problem with CATiledLayer is you have very little control over it.
Lots of various people have played around with altering the transform which I didn't have much success with (could be due to iOS 4 changes?).
However, I think I have found a solution which would make sense based on how Apple's CATiledLayer works and CAShapeLayer's documentation. You just need to redraw the layer's image at the scaled value into a CGImage (CGBitmapContext) and set that as the layer's contents.
It's working well right now in the simulator, but I feel like there should be a better way to go about it. What do you guys think? I can post a sample project.
However if you try to add sublayers to CATiledLayer, you don't get the nice sharpened scaling automatically (CAShapeLayer does work though). The other problem with CATiledLayer is you have very little control over it.
Lots of various people have played around with altering the transform which I didn't have much success with (could be due to iOS 4 changes?).
However, I think I have found a solution which would make sense based on how Apple's CATiledLayer works and CAShapeLayer's documentation. You just need to redraw the layer's image at the scaled value into a CGImage (CGBitmapContext) and set that as the layer's contents.
It's working well right now in the simulator, but I feel like there should be a better way to go about it. What do you guys think? I can post a sample project.