|
I have a scrollView with an Image, which the user can pan and zoom, like in the Apple Photos App. I would like to get the location (xy) the user long pressed (being the pixel x and pixel y coordinates of the Image). In my UIKit app this was rather simple:
I can't seem to figure out how to achieve the same in SwiftUI. Any help appreciated! |
|
|
|
|
|
Sorry, been a while. I managed to get the location with a sequenced gesture. Though the numbers are roughly half what I expect to get back, perhaps a points vs pixel thing? Here's the ImageZoomView
More exploring and thinkering to do, but it's a start ... |
|
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.