Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
- NSIndexPath *indexPathCopy = [NSIndexPath indexPathForRow:indexPath.row inSection:indexPath.section];
- NSString *sizeString = self.heightCache[indexPathCopy];
- if (sizeString) {
- CGSize size = CGSizeFromString(sizeString);
- NSLog(@"estimatedHeightForRowAtIndexPath %f row %ld",size.height, (long)indexPath.row);
- return size.height;
- }
- return UITableViewAutomaticDimension;
- }
- - (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
- NSIndexPath *indexPathCopy = [NSIndexPath indexPathForRow:indexPath.row inSection:indexPath.section];
- self.heightCache[indexPathCopy] = NSStringFromCGSize(cell.frame.size);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement