File tree Expand file tree Collapse file tree
TableViewCellWithAutoLayout/TableViewController Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ - (NSString *)randomLorumIpsum {
5050 int r = arc4random () % [lorumIpsumArray count ];
5151 NSArray *lorumIpsumRandom = [lorumIpsumArray objectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange (0 , r)]];
5252
53- // Array to string. Adding <START> <END> tags to ensure all text visible.
53+ // Array to string. Adding '!!!' to end of string to ensure all text is visible.
5454 //
55- return [NSString stringWithFormat: @" <START> %@ <END> " , [lorumIpsumRandom componentsJoinedByString: @" " ]];
55+ return [NSString stringWithFormat: @" %@ !!! " , [lorumIpsumRandom componentsJoinedByString: @" " ]];
5656
5757}
5858
Original file line number Diff line number Diff line change @@ -111,9 +111,9 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa
111111 // Make sure the cell has constraints setup before asking it to layout
112112 [cell setNeedsUpdateConstraints ];
113113 [cell updateConstraintsIfNeeded ];
114-
115114 [cell.contentView setNeedsLayout ];
116115 [cell.contentView layoutIfNeeded ];
116+
117117 CGFloat height = [cell.contentView systemLayoutSizeFittingSize: UILayoutFittingCompressedSize].height ;
118118
119119 NSLog (@" My returned height = %f " , height);
You can’t perform that action at this time.
0 commit comments