iPhone TabbarController Switch Transition
Posted
by user269737
on Stack Overflow
See other posts from Stack Overflow
or by user269737
Published on 2010-02-10T06:25:01Z
Indexed on
2010/05/22
15:10 UTC
Read the original article
Hit count: 289
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;
}
© Stack Overflow or respective owner