spentak
spentak

Reputation: 4747

iOS Touches Began

What I want: Touch a button and a view is added right where the touch is. Without having to lift the finger the touches began/moved automatically begins working on the UIView. So without lifting the finger, I have touched the button and can drag the new view around.

What I don't know how to do:

Stop the touch events on the button and immediately send the touch events to the new view that is directly under the finger.

Upvotes: 3

Views: 751

Answers (2)

Paul.s
Paul.s

Reputation: 38728

As @Daniel suggested ditch the button and just use a UIView, but I believe you may need to have a UIPanGestureRecognizer in place to get your dragging.

You could set a flag when a new UIView is created and then forward any gesture events to that view - only while the user still has their finger down from the initial touch.

After the user has lifted their finger the new view can just deal with gestures by itself by adding a UIPanGestureRecognizer to it.

Upvotes: 1

Daniel
Daniel

Reputation: 22405

One option could be to ditch the button and just use the uiview touches to detect when to add the subview you want to let the user drag...

Daniel

Upvotes: 2

Related Questions