|
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 ... |
|
BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.
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.