Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

LightCoder

macrumors newbie
Original poster
May 21, 2018
2
0
Hey all, I'm trying to figure out how to get a 2D touch interface overlay on an image. The image is of a Pan/Tilt grid that I want to overlay with a dot of some sort that shows the current value based on variables I have in the background. I have the image created and well adjusted within storyboard but I'm at a loss for how to create the touchable interface with that dot for feedback. Anyone done something similar to this?? Currently I have the values being adjustable with sliders and want to have the grid interface as well.
 
You can track the finger with a UIPanGestureRecognizer. Your custom view will need a property for the position of the dot and its draw() method should draw the dot at the correct position. As the panGestureRecognizer calls back to the view it should update the position property and self.setNeedsDisplay().

Probably your custom view will be transparent and the ImageView will just be behind it.
 
  • Like
Reactions: CobraPA
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.