Skip to content

Instantly share code, notes, and snippets.

@dannewns
Created December 19, 2013 15:33
Show Gist options
  • Save dannewns/8041051 to your computer and use it in GitHub Desktop.
Save dannewns/8041051 to your computer and use it in GitHub Desktop.
ok this is probably totally wrong i know i should assign a tag in the if statment to the label and then outside of the if get the label by tag and then assign the value
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"EventCell" forIndexPath:indexPath];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"EventCell"];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(34.0f, 34.0f, tableView.frame.size.width, 130.f)];
label.textAlignment = NSTextAlignmentLeft;
label.font = [UIFont fontWithName:@"BrandonGrotesque-Black" size:40];
label.textColor = [UIColor whiteColor];
[cell.contentView addSubview:label];
Event *event = _events[indexPath.row];
label.text = event.title;
}
return cell;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment