How to trigger tap gesture recognizer of UIView programmatically

techcraze

I want to get tap gesture recogniser attached to an UIView and trigger it programatically. I successfully found a way to find tap gesture recogniser of an UIView. But now I don't know how to trigger it programatically. I am working on app crawler. So if I have a source code of a ViewController then, my crawler will start crawling find all the subviews of ViewController. Also the crawler will find gesture attached to the subviews. And trigger tap gesture.

Note : I know how to attach gesture recogniser to UIView and trigger it. But in my case I wanted to automate the clicking process of an app. Just consider as I want to runtime find tap gesture recogniser of UIView and trigger it.

techcraze

I solved this by creating fake touches. Triggering gesture was not possible as gestures does not expose its action and selector. But as I have UIView on which I want to tap. I can create a fake touch on that UIView. This fake touch will automatically trigger the tap gesture. This link was very helpful for this.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to trigger tap gesture recognizer of UIView programmatically

From Dev

How to add a double tap Gesture Recognizer in Swift

From Dev

Tap Gesture Recognizer not received in custom UIView embedded in super view

From Dev

didSelectRowAtIndexPath is in conflict with Tap Gesture Recognizer

From Dev

Disable uipopover tap gesture recognizer

From Dev

How to implement a tap gesture recognizer for multiple subviews with Swift

From Dev

How to implement a tap gesture recognizer for multiple subviews with Swift

From Dev

How do you remove tap gesture recognizer from the scene dock?

From Dev

Tap Gesture Recognizer is one tap behind

From Dev

UIView with Tap Gesture Segue

From Dev

UIView with Tap Gesture Segue

From Dev

Programmatically Starting Gesture Recognizer In Swift?

From Dev

tap gesture recognizer - which object was tapped?

From Dev

Tap Gesture on animating UIView not working

From Dev

Allow both single tap gesture recognizer and double tap in UIScrollView

From Dev

iOS 7 - transparent UIView blocking gesture recognizer

From Dev

UIView blocking UIScrollView's gesture recognizer

From Dev

How to assign a gesture recognizer to a collection?

From Dev

UICollectionView: Adding single Tap Gesture Recognizer to supplementary view

From Dev

AVAudioPlayer not playing sound when tap gesture recognizer pressed

From Dev

Pass tap gesture from UIView to underlying AVPlayer

From Dev

UIView with label + button - Tap gesture not recognized

From Dev

iOS `UIView` stops responding to gesture recognizer when its alpha is 0?

From Dev

Enable user interaction for gesture recognizer during UIView.animateWithDuration()

From Dev

How to have a UIScrollView scroll and have a gesture recognizer?

From Dev

How to add a gesture recognizer to a shape drawn by uibezierpath

From Dev

How can I remove Gesture recognizer in Xcode?

From Dev

how to add gesture recognizer to ViewController and to its Children?

From Dev

How to add a gesture recognizer to a shape drawn by uibezierpath

Related Related

  1. 1

    How to trigger tap gesture recognizer of UIView programmatically

  2. 2

    How to add a double tap Gesture Recognizer in Swift

  3. 3

    Tap Gesture Recognizer not received in custom UIView embedded in super view

  4. 4

    didSelectRowAtIndexPath is in conflict with Tap Gesture Recognizer

  5. 5

    Disable uipopover tap gesture recognizer

  6. 6

    How to implement a tap gesture recognizer for multiple subviews with Swift

  7. 7

    How to implement a tap gesture recognizer for multiple subviews with Swift

  8. 8

    How do you remove tap gesture recognizer from the scene dock?

  9. 9

    Tap Gesture Recognizer is one tap behind

  10. 10

    UIView with Tap Gesture Segue

  11. 11

    UIView with Tap Gesture Segue

  12. 12

    Programmatically Starting Gesture Recognizer In Swift?

  13. 13

    tap gesture recognizer - which object was tapped?

  14. 14

    Tap Gesture on animating UIView not working

  15. 15

    Allow both single tap gesture recognizer and double tap in UIScrollView

  16. 16

    iOS 7 - transparent UIView blocking gesture recognizer

  17. 17

    UIView blocking UIScrollView's gesture recognizer

  18. 18

    How to assign a gesture recognizer to a collection?

  19. 19

    UICollectionView: Adding single Tap Gesture Recognizer to supplementary view

  20. 20

    AVAudioPlayer not playing sound when tap gesture recognizer pressed

  21. 21

    Pass tap gesture from UIView to underlying AVPlayer

  22. 22

    UIView with label + button - Tap gesture not recognized

  23. 23

    iOS `UIView` stops responding to gesture recognizer when its alpha is 0?

  24. 24

    Enable user interaction for gesture recognizer during UIView.animateWithDuration()

  25. 25

    How to have a UIScrollView scroll and have a gesture recognizer?

  26. 26

    How to add a gesture recognizer to a shape drawn by uibezierpath

  27. 27

    How can I remove Gesture recognizer in Xcode?

  28. 28

    how to add gesture recognizer to ViewController and to its Children?

  29. 29

    How to add a gesture recognizer to a shape drawn by uibezierpath

HotTag

Archive