Is there a way to invoke TouchesBegan, TouchesMoved, TouchedEnded programmatically ??
No, you can't. Unfortunately, UIEvent
doesn't expose any public way to create events; only the internal dispatcher is allowed to do that. You can't cook up your own events from scratch and use them in a meaningful way.
Sounds like you might be able in your application to forward the events-- by taking them from the place where they land originally, and just sending them to the view that you want to consume them by calling those methods directly. Depending on what those views are, make sure you fully understand the event dispatch sequence (hit testing etc), though, so you don't confuse UIKit views.
It's just a method so you could call it and create the events yourself I assume (assumptions are bad though). If you are trying to trigger your own touchesX code it would seem easier to just move that to its own method and call it straight away.
Exactly what are you trying to achieve?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With