I have an image with size 480x360
and am displaying in UIImageview
with frame (0, 0, 320, 568)
with aspectfill
.
W
You just calculate the proportions and apply them to touch location point.
CGFloat _x = imageView.image.size.width / imageView.frame.size.width;
CGFloat _y = imageView.image.size.height / imageView.frame.size.height;
//assuming p - is CGPoint received from Touch event
CGPoint locationInImageView = CGPointMake(p.x * _x, p.y * _y);