Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-4508

iOS: Need the pinch gesture exposed for TIUIView event listeners

    Details

      Description

      We need to have the event handler for pinch gestures available for TIUIView objects and their derivatives

      This is needed for many projects we've been a apart of.

      We recently implemented this in the soon to be available openGL module development project (ios only so far) and it seems to work for our needs there.

      Having this available for all views and objects that are based on view objects would be very useful.

      Here are the code snippets from the IOS side:

      Added this to the view initialization:

      UIPinchGestureRecognizer *pinchRecognizer;
      pinchRecognizer=[[UIPinchGestureRecognizer alloc]
      initWithTarget:self
      action:@selector(foundPinch];
      [controller.view addGestureRecognizer:pinchRecognizer];
      [pinchRecognizer release];

      here's the callback:

      • (void)foundPinch:(UIPinchGestureRecognizer *)recognizer { NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:NUMDOUBLE(recognizer.scale), @"scale", NUMDOUBLE(recognizer.velocity), @"velocity", nil]; [self.proxy fireEvent:@"pinch" withObject:event]; }

      here's how we use it now on the opengl view

      opengl.addEventListener('pinch', function

      { scale = e.scale; }

      );

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rseagraves Reggie Seagraves
                Reporter:
                patakijv John V Pataki
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration