Home:ALL Converter>Pass touch to another view controller (iOS)

Pass touch to another view controller (iOS)

Ask Time:2016-08-11T03:44:32         Author:Josh O'Connor

Json Formatter

I have a long press gesture which presents another controller. In the presented controller, I have touchesBegan(), touchesMoved(), and touchedEnded() methods which detect touching on the view controller.

When I long press, and hold down, the next view controller is presented. If I do not release the long press, and move my finger on the screen, the touchesMoved() method does not get called, and when I stop touching, the touchesEnded() is not called. However, when I release the long press touch, and touch it again, these methods will be called, since the long press gesture recognizer is no longer receiving the touch, and rather the presented view controller receives the touches.

Is there anyway for the presented screen to recognize the touches, while still pressing the long press? How do I pass this long press recognizer to the next view controller?

Author:Josh O'Connor,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/38882228/pass-touch-to-another-view-controller-ios
yy