objective-ciosthree20ttnavigator

ios three20 animation on back


i'm using the three20 lib and in depth ttnavigator: my question is this: with this code I change the animation to go in the new navigation:

TTURLAction* action;
action = [TTURLAction actionWithURLPath:@"tt://events"]; 
[action setAnimated:YES];
[action setTransition:UIViewAnimationTransitionFlipFromLeft];
[[TTNavigator navigator] openURLAction:action];

and the animation is good, but when in the new view I click the back button, the animation is the standard scroll...it's possible mantain the same?

thanks in advance


Solution

  • If you declare the URL in the TTURLMap, three20 will do that automatically when you dismiss your view controller:

    in your app delegate:

    TTNavigator* navigator = [TTNavigator navigator];
    navigator.persistenceMode = TTNavigatorPersistenceModeNone;
    TTURLMap* map = navigator.URLMap;
    
    [map from:@"tt://settings" toViewController:[SettingsController class] transition:UIViewAnimationTransitionFlipFromLeft];
    
    [navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://settings"]];
    

    and in your settings controller, you can use a custom button, so it won't look as a back button:

    ///////////////////////////////////////////////////////////////////////////////////////////////////
    - (void)viewDidLoad {
      [super viewDidLoad];
    
    
       TTButton* settingsButton = [TTButton 
                              buttonWithStyle:@"grayToolbarButton:" 
                              title:NSLocalizedString(@"DONE", @"")];
        [settingsButton sizeToFit];
    
         [settingsButton addTarget:self action:@selector(dismissSettings)
           forControlEvents:UIControlEventTouchUpInside]; 
    
     self.navigationItem.hidesBackButton = YES;
     self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] 
                                            initWithCustomView:settingsButton] autorelease];
    }
    
    
     ///////////////////////////////////////////////////////////////////////////////////////////////////
    - (void)dismissSettings {
      [self.navigationController popViewControllerAnimated:YES];
    }