I have this following problem which I can’t seem solve:
In my top view (a menu bar), I have a UIButton on which I want the user to press and then drag and drop an object (OpenGL object that spawns fine) to the view under the menu bar (an EAGLView). My problem is that I cannot pass the touch location of where the user presses down on the button to the EAGLView.
I have tried several solutions :
-
Assign a selector to the Drag-In-Touch function of the
UIButton. This allows me to get the touch position I could want, but this location only stays in bounds of the view holding theUIButton(the menu bar) -
Override the
touchesBegan/Moved/Endedof theUIButtonso they use the touches of thenextResponder.nextResponder(making this theEAGLView). This seemed to work for thetouchesBegan, but the second I try to move around,touchesMovedis called once and then stops.
If any of you could point me to any possible ways of accomplishing what I want, I’d be most grateful.
Not completely answering the question here, but what you want could be solved by adding UIviews instead of UIButtons and dragging them on screen using a Pangesture recognizer. Then, you simply load or place the object you want under this view at the moment the user ends the pan/drag motion.