vrwim
vrwim

Reputation: 14320

How can I get the coordinates in didSelectRowAtIndexPath

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.

Upvotes: 0

Views: 170

Answers (1)

JordanC
JordanC

Reputation: 1323

- (CGRect)rectForRowAtIndexPath:(NSIndexPath *)indexPath

- (NSIndexPath *)indexPathForSelectedRow

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

Upvotes: 3

Related Questions