I was hoping someone could help me out. I am trying to allow a user to pinch zoom on a UIImageView(with a max and min level allowed). But for some reason the it does not wor
This is an old question but I don't see any answers that explain what is wrong with the original code.
This line:
let currentScale = self.view.frame.size.width / self.view.bounds.size.width
Is working on the main view rather than the imageView so the scale calculation is always ~1
This simple change makes it behave as expected
let currentScale = sender.view!.frame.size.width / sender.view!.bounds.size.width
by changing self to sender (and forcing view to unwrap) the scale calculation works as expected.