Created
February 10, 2014 23:43
-
-
Save bobspryn/8926541 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| if (indexPath.row == 1) { | |
| static JotoTutorialTagsTableViewCell *sizingCell; | |
| if (!sizingCell) { | |
| sizingCell = [tableView dequeueReusableCellWithIdentifier:@"tutorialTagsCell"]; | |
| } | |
| sizingCell.frame = CGRectMake(0, 0, self.tableView.frame.size.width, self.tableView.frame.size.height); | |
| NSString *category = [self.interestArray objectAtIndex:indexPath.section]; | |
| NSArray *tags = [self tagsForCategory:category]; | |
| [sizingCell setTags:tags]; | |
| [sizingCell setNeedsLayout]; | |
| [sizingCell layoutIfNeeded]; | |
| CGFloat height = [sizingCell heightForTagsView]; | |
| //add 40px for next category button in all categories but last | |
| if(indexPath.section < self.interestArray.count - 1) | |
| return height + 80 + 40; | |
| else | |
| return height + 80; | |
| } | |
| return [super tableView:tableView heightForRowAtIndexPath:indexPath]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment