views:

366

answers:

1

I've implemented gestures (touchBegan-moved-ended) in order to allow for swiping through my tabs. It works. I'd like to add a slide-from-left and slide-from-right transition. It would be better if it could be part of the gesture if statement which tells me if the swipe is towards the right of left. Since I determine which tab is displayed from that, I could show that specific transition along with the new tab.

So my question is this: what's the simplest way to simplement a slide transition at a specific instance. I don't want it to be for the whole tabbarcontrol since this is specifically for the swiping.

Thanks for the help, much appreciated.

For clarification purposes, this is snippet shows how I'm switching tabs:

if(abs(diffx / diffy) > 2.5 && abs(diffx) > HORIZ_SWIPE_DRAG_MIN) {

// It appears to be a swipe.
  if(isProcessingListMove) {
   // ignore move, we're currently processing the swipe
   return;
  }

  if (mystartTouchPosition.x < currentTouchPosition.x) {
   isProcessingListMove = YES;
   self.tabBarController.selectedViewController = [self.tabBarController.viewControllers objectAtIndex:0];
   return;
  }
  else {
   isProcessingListMove = YES;

   self.tabBarController.selectedViewController = [self.tabBarController.viewControllers objectAtIndex:1 ];

   return;
  }
A: 

can you add the entire code please?

Fast