So, I was having trouble mostly because of my constraints in the storyboard. For the code below, you need to ensure that the height and width match the (scaled) image, NOT the view or the screen size - so just selecting an Aspect Fit content mode and letting the image scale up won't work. I added an aspect ratio constraint, as well as trailing and leading spaces that were a bit flexible (>= 0). Anyway, if you can get the "bounds" of the image to successfully sit around the actual bounds of the image, you should be set to use the code below.
This code takes the coordinates of a touch based on the image, then calculates where the X/Y value should be for that touch, based on the aspect ratio. So, even though you've got a couple thousand pixels on your phone, a touch on the left eye located at 100x150 in a 200x300 smiley face should successfully return "X: 100 Y: 150."
@IBOutlet weak var image: UIImageView!
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
if let touch = touches.first {
//based on the touch on an image, grab the X/Y value
let imageViewPoint = touch.location(in: self.image)
//get the ratio by dividing the scaled bounds of the image by the unscaled size of the image
let widthRatio = image.bounds.size.width / (image.image?.size.width)!
let heightRatio = image.bounds.size.height / (image.image?.size.height)!
//divide the touch coordinates by the ratios to get your result
let endResultX = imageViewPoint.x / widthRatio
let endResultY = imageViewPoint.y / heightRatio
print("X End Result: ", endResultX)
print("Y End Result: ", endResultY)
}
}