I have an UICollectionView where I am reusing many UICollectionViewCells with product information, think of Pinterest.
But it comes to a point where I have a price tag and would like to rotate the price ribbon about 45 degrees for everyone of the cells.

What would be the best performance wise method to achieve that?
I have tried with:
#import <QuartzCore/QuartzCore.h>
@interface ItemCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UILabel *price;
@end
@implementation ItemCollectionViewCell
@synthesize price;
- (void)awakeFromNib {
price.layer.transform = CATransform3DMakeRotation(M_PI_4, 0, 0, 1);
price.layer.transform = CATransform3DTranslate(price.transform, 25, -15, 0);
price.layer.shouldRasterize = YES;
}
@end
But the overall result as scrolling and pushing new views into the navigation controller is really slow.
Update
- It seems that iOS6 Autolayout is the main cause for the performance decrease, but I still don’t know how to fix this or remove autolayout only for the price label.
What worked for me was to remove the attributes defined by iOS6 autoLayout feature inside the
UICollectionViewCellwhere it sets constraints for thepricelabel, being: