UIImageView with touch interface/feedback

Discussion in 'iOS Programming' started by LightCoder, Jun 2, 2018.

  1. LightCoder macrumors newbie

    May 21, 2018
    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.
  2. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    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.

Share This Page