Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)tableView:(UITableView *)tableView didUpdateFocusInContext:(UITableViewFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
- {
- //this gives you the indexpath of the focused cell
- NSIndexPath *nextIndexPath = [context nextFocusedIndexPath];
- }
- NSIndexPath *nextIndexPath = [context nextFocusedIndexPath];
- NSIndexPath *prevIndexPath = [context previouslyFocusedIndexPath];
- UITableViewCell *nextCell = [self.tableView cellForRowAtIndexPath:nextIndexPath];
- UILabel *nextTitleLabel = (UILabel *)[nextCell viewWithTag:100];
- nextTitleLabel.textColor = [UIColor blackColor];
- UITableViewCell *prevCell = [self.tableView cellForRowAtIndexPath:prevIndexPath];
- UILabel *prevTitleLabel = (UILabel *)[prevCell viewWithTag:100];
- prevTitleLabel.textColor = [UIColor whiteColor];
- override func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) {
- let cell = context.nextFocusedView as! UITableViewCell
- let indexPath = table.indexPath(for: cell)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement