Waitak Jong
Waitak Jong

Reputation: 87

How to get the origin(in the screen) of a image that placed in the tableviewcell?

How to get the origin of a image that placed in the UITableViewCell? The origin I mean is its origin that in the screen not inside the UITableViewCell.

Upvotes: 0

Views: 31

Answers (1)

EmilioPelaez
EmilioPelaez

Reputation: 19902

UIView has a couple of methods that are very useful for that kind of stuff, they start with convertRect:... and convertPoint:... and end with fromView: and toView:.

In your case, calling convertPoint:CGPointZero toView:tableView on the image view would return what you need.

These methods only work if both views are in the same view hierarchy.

Upvotes: 1

Related Questions