I'm using a UIImageView
for each of my UITableViewCells
, as thumbnails. My code uses SDWebImage
to asynchronously grab those images from my backend and load them in, and then caching them. This is working fine.
My UIImageView
is a 50x50 square, created in Interface Builder. Its background is opaque, white color (same as my UITableViewCell
background color, for performance). However, I'd like to use smooth corners for better aesthetics. If I do this:
UIImageView *itemImageView = (UIImageView *)[cell viewWithTag:100];
itemImageView.layer.cornerRadius = 2.5f;
itemImageView.layer.masksToBounds = NO;
itemImageView.clipsToBounds = YES;
My tableview drops around 5-6 frames immediately, capping about 56 FPS during fast scrolling (which is okay), but when I drag and pull the refresh control, it lags a bit and drops to around 40 FPS. If I remove the cornerRadius
line, all is fine and no lag. This has been tested on an iPod touch 5G using Instruments.
Is there any other way I could have a rounded UIImageView
for my cells and not suffer a performance hit? I'd already optimized my cellForRowAtIndexPath
and I get 56-59 FPS while fast scrolling with no cornerRadius
.