I have a UITableView that uses auto-layout. I have several types of cells, but now let's use the simplest of all that only UILabel has.
In tableView:heightForRowAtIndexPath: I have the following code:
[self configureCell:self.detailsCell forRowAtIndexPath:indexPath]; [self.detailsCell layoutIfNeeded]; CGSize size = [self.detailsCell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; return size.height + 1;
which in turn causes
- (void)configureCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {

and I get the following:

The green rectangle is the actual cell. Purple Rectangle - UILabel. I don't want upper and lower purple indentation / margin. How can I get rid of it?
source share