1

I am trying to get notified on all kinds of gesture that happen on my iOS app.

To be precise: I want to see how my users are interacting with my app It helps me to see if my controls are well made and self documented. For instance, it will allow me to see if users are trying to pinch in/out a knob instead of rotating it, etc.

What I tried to do at the moment was to have another invisible UIWindow on top of my application and record touch events passing through it (with touchesBegan, ...) but this doesn't tell me what iOS ended up with as a gesture.

If someone already has made something like this or has any tip on how to achieve such a thing, it would save me from headaches ;)

Thank you!

  • I don't want to be control specific (as my app has many controls) but I want to see if there is a generic way of doing this for everything my app uses (such as buttons, images, ...) – Alex Rondham Jun 01 '16 at 10:25
  • 1
    There isn't - and there can't be. While you might be able to intercept and log all touches, their interpretation is highly depending on the context (and partly configurable). – Eiko Jun 01 '16 at 10:32
  • I just saw that some analytic frameworks are doing exactly what I want, such as AppSee: they record everything that is happening on screen (any gesture, any where). But I don't want the full package - just the fact of being notified on any gesture ;'( – Alex Rondham Jun 01 '16 at 10:39

2 Answers2

0

You can make a web service which you call in the background every time something happens on the app. Where you recognize the gesture you can put the call there and in button actions etc.
But it'll make the app slow as I didn't knew about any other library which can do that so this is one possible solution.

Chaudhry Talha
  • 7,231
  • 11
  • 67
  • 116
  • I did this part already ;) (and imho it was the easy part) Where I am stuck at is the part that will recognize any gesture on screen, like some analytics frameworks are doing... – Alex Rondham Jun 01 '16 at 10:41
0

You can take a look at the Google Analytics SDK

In order to track what you want you have to send a custom event to Analytics, as long as you know when a specific event raises (for example a button click) you can track everything.

Here's an example on how to send a custom event:

// May return nil if a tracker has not already been initialized with a property
// ID.
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];

[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"ui_action"
                                                      action:@"button_press"
                                                       label:@"play"
                                                       value:nil] build]];
LS_
  • 6,763
  • 9
  • 52
  • 88
  • Yes I have this part = sending events to my server, etc. What I'm looking for is a way to get these events in order to tell my server what happened – Alex Rondham Jun 01 '16 at 10:40
  • I'm sorry I misunderstood the question, then take a look at how to override the method HitTest, it should allow you to track everything you need, eg: http://stackoverflow.com/questions/26364799/detecting-a-touch-anywhere-on-the-screen – LS_ Jun 01 '16 at 10:45
  • Thank you! I'm looking to it... that may indeed help me find a way! – Alex Rondham Jun 01 '16 at 10:47
  • No problem! hopefully it's what you're looking for :) – LS_ Jun 01 '16 at 10:52