You can try adding shadowPath to your init cell, this should improve the performance of the code that I used in one of my projects to add a rounded shadowPath (see UIBezierPath methods for more choices)
self.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:self.frame.bounds byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(10, 10)].CGPath;
In addition, if I remember correctly, AFNetworking does not change the size of the image returned from the server, so this may affect the quality of your image (despite the scaling method that you added to UIImageView), I recommend sending the returned image to change it if you want:
CGSize targetSize = cell.photoView.bounds.size; [cell.photoView setImageWithURLRequest:photoRequest placeholderImage:nil success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ CGFloat imageHeight = image.size.height; CGFloat imageWidth = image.size.width; CGSize newSize = weakCell.imageView.bounds.size; CGFloat scaleFactor = targetSize.width / imageWidth; newSize.height = imageHeight * scaleFactor; UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0); [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; UIImage *small = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); dispatch_async(dispatch_get_main_queue(),^{ weakCell.photoView.image = small; }); }); } failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) { NSLog(@"Error retrieving thumbnail... %@", [error localizedDescription]); }];
source share