Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

North Bronson

macrumors 6502
Original poster
Does anyone have experience using CATiledLayer for a large view?

I have an Image View that I'm adding to a UIScrollView. I thought about subclassing UIImageView to look like this:

Code:
@interface CustomImageView: UIImageView

@end

@implementation CustomImageView

+ (Class)layerClass
{
    return [CATiledLayer class];
}

@end

Is that really all that I need to have the benefits of the tiled layer? Am I missing something here?

I'm not sure what I should be looking for to see if it's really working well or not.
 
UIImageView isn't meant to be subclassed.

The point of CATiledLayer is that you can provide the contents of the view in tiles. If you do that then you can use less memory because only part of the view's contents need to exist at any time. There would be no point to creating a single view for display in a tiled layer. You need to be able to create tiles.

The code that you show may work but there's no benefit.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.