I have a dynamic custom UITableViewCell that uses auto-layout.
I change the text content of the label, depending on the width of the cell.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ... cell.someLabel.text = CGRectGetWidth(cell.bounds) < 321 ? @"Concise" : @"Much longer blurb"; return cell; }
reloadData is called during the orientation transition to update the label.
While this works, I believe there is a better way to handle this, which is not related to the overhead of reloading the tableView.
(None of the restrictions need to be changed. The label is in one place, but just displays different content when there is more space for this.)
Thanks for any answers!
ios objective-c uitableview autolayout ios8
user4151918
source share