Note that there are some explanatory texts on larger screens.

plurals
  1. POJerky scrolling of UICollectionView because of text labels
    text
    copied!<p>I have got a problem with jerky scrolling of UICollectionView. My cell consists of picture and a few text labels.</p> <p>I have tried to check what is causing this and when I disabled setting text for labels everything is smooth, when I set text for more than two labels scrolling is jerky again...</p> <p>Does anyone know how to solve it?</p> <p>Here is my code:</p> <pre><code>- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"ResultCell"; ResultCellView *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath]; if ([self.artworksSavedForLater containsObject:indexPath]) { cell.saveForLaterButton.selected = YES; } else cell.saveForLaterButton.selected = NO; Artwork *artwork = [self.dataHelper.fetchedResultsController objectAtIndexPath:indexPath]; cell.title.text = artwork.title; cell.owner.text = artwork.owner; cell.fields.text = artwork.fields; cell.numberOfViews.text = [NSString stringWithFormat:@"%@",artwork.views]; cell.numberOfLikes.text = [NSString stringWithFormat:@"%@",artwork.likes]; cell.numberOfComments.text = [NSString stringWithFormat:@"%@",artwork.comments]; cell.publishedDate.text = artwork.publishedDate; if ([artwork.hasThumbnail boolValue]) { dispatch_queue_t downloadQueue = dispatch_queue_create("imagecache", NULL); dispatch_async(downloadQueue, ^{ UIImage *productImage = [UIImage imageWithData:artwork.thumbnail]; CGSize imageSize = productImage.size; UIGraphicsBeginImageContext(imageSize); [productImage drawInRect:CGRectMake(0, 0, imageSize.width, imageSize.height)]; productImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); dispatch_async(dispatch_get_main_queue(), ^ { cell.thumbnailImage.image = productImage; cell.thumbnailImage.hidden = NO; }); }); } else { cell.thumbnailImage.hidden = YES; [self startOperationsForPhotoRecord:artwork atIndexPath:indexPath]; } return cell; </code></pre> <p>Code for my cell:</p> <pre><code>- (void)didMoveToSuperview { [super didMoveToSuperview]; self.title.font = [UIFont fontWithName:@"VerbRegular" size:14.0]; self.layer.borderColor = [UIColor colorWithWhite:0.19f alpha:1.0f].CGColor; self.layer.borderWidth = 1.0f; self.layer.rasterizationScale = [UIScreen mainScreen].scale; self.layer.shouldRasterize = YES; } - (void)prepareForReuse { [super prepareForReuse]; self.thumbnailImage.image = nil; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload