tags:

views:

399

answers:

2
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 
{
    if (dirString) 
    {
            CATransition *animation = [self getAnimation:dirString];
            [[self superview] exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
            [[[self superview] layer] addAnimation:animation forKey:kAnimationKey];
    }
}

Hello all Im trying to work with the code above it may look familiar its from the Iphone Developer Cookbook, Erica Sandun

what im trying to implement are 5 different views using her swipe method the code above has a transition between 2 views only, how would i change the code so i can swipe through all five views, example: view starts on view 1 then user swipes right then changes to view 2 and so forth and backward your help is much appreciated

+1  A: 

Check out Apple's example on how to use UIScrollView for paging between multiple views:

http://developer.apple.com/iphone/library/samplecode/PageControl/index.html#//apple%5Fref/doc/uid/DTS40007795

Jeremy
A: 

good! is it possible to add an answer/question/thread in a favourite list here so that i can come back to it again without searching again?

karim