How can I get the coordinates in didSelectRowAtIndexPath

172 views Asked by At

I have a UITableView where selecting a row trigger an MPMoviePlayerController with a video. I'm setting the size to 0, so it's invisible.

Now I'd like to make the hiding animation nicer, by having it converge on the cell that was selected.

I can't seem to find a way to get the coordinates of the selected row without doing some ridiculous thing such as making a transparent UIView on top of the UITableView.

1

There are 1 answers

1
JordanC On BEST ANSWER
- (CGRect)rectForRowAtIndexPath:(NSIndexPath *)indexPath

- (NSIndexPath *)indexPathForSelectedRow

CGRect yourRect = [tableView rectForRowAtIndexPath: [tableView indexPathForSelectedRow]];