is this code future proof for customising color of EKEventViews (code attached)? i.e should it be ok as apple rev's versions of IOS.
if not, what code would you recommend?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
self.detailViewController = [[EKEventViewController alloc] initWithNibName:nil bundle:nil];
detailViewController.event = [self.eventsList objectAtIndex:indexPath.row];
[self.navigationController pushViewController:detailViewController animated:YES];
// CODE UNDER QUESTION HERE
UITableView *tv = (UITableView*)[detailViewController.view.subviews objectAtIndex:0];
[tv setBackgroundColor:[UIColor yellowColor]];
UIView *v = (UIView*)[[tv visibleCells] objectAtIndex:0];
v.backgroundColor = [UIColor greenColor];
}
It's perfectly valid now, but Apple at any time could change the structure of the
UITableView
orEKEventViewController
breaking your customizations. Try looking into the newtintColor
properties. Also, where do you interact with the table view otherwise? You're not just presenting it and leaving it, correct? Therefore, where else can you possibly change it. I need more code to help. You can also just set[detailViewController.view.subviews objectAtIndex:0].backgroundColor' to
[UIColor yellowColor]` and likewise.