Im using UICollectionView for showing listing of images using SDWebImage which is very jerky and the scroll is not smooth. Any suggestions as to how do I proceed with this?
below is code in
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
NSString * cellIdentifier = @"offersCell";
HotDealsCollectionViewCell * cell = (HotDealsCollectionViewCell *)[self.productsCollectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
cell.layer.shouldRasterize = YES;
cell.layer.rasterizationScale = [UIScreen mainScreen].scale;
cell.layer.shadowColor = [[UIColor colorWithRed:210.0/255.0 green:210.0/255.0 blue:210.0/255.0 alpha:1.0] CGColor];
cell.layer.shadowOffset = CGSizeMake(2.0f, 2.0f);
cell.layer.shadowRadius = 3.0f;
cell.layer.shadowOpacity = 1.0f;
cell.layer.masksToBounds = NO;
CGRect shadowFrame = cell.layer.bounds;
CGPathRef shadowPath = [UIBezierPath bezierPathWithRect:shadowFrame].CGPath;
cell.layer.shadowPath = shadowPath;
cell.backgroundColor = [UIColor whiteColor];
if ([self.productsArray count] > 0) {
Product * product = [self.productsArray objectAtIndex:indexPath.item];
cell.productName.text = product.productName;
cell.productEndDate.hidden = NO;
cell.productImageView.clipsToBounds = YES;
cell.productEndDate.textAlignment = NSTextAlignmentCenter;
[cell.productImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@", product.productImage]] placeholderImage:[UIImage imageNamed:@"noProduct"]];
}
return cell;
}