Using CATransition In Three20?

I am looking to implement CATransitions in TTNavigator, I know the openURL method can accept UIViewAnimationTransition, but it only gives me flipping and curling animations, but with CATransition I have access to another 8 of which kCATransitionFromRight, kCATransitionFromLeft, kCATransitionFromTop, kCATransitionFrom that I am especially after.

Using the UINavigationController will use something like this piece of code to give me more control over the animation:

    CATransition *transition = [CATransition animation];
    transition.duration = 0.5f;
    transition.timingFunction = [CAMediaTimingFunction
    functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    transition.type = kCATransitionPush;
    [self.navigationController.view.layer addAnimation:transition
    forKey:nil];

This code, however, does not work with TTNavigator. Does anyone know how I can use my own animations to work with TTNavigator? Or if I am doing something wrong in my code?

+3
2

, , , navigationController, URLAction. , URLAction, , !

    // create the URLAction
TTURLAction* urlAction;
urlAction = [TTURLAction actionWithURLPath:@"tt://Images"]; 
[urlAction applyAnimated:YES];

    // create the CATransition and set it to the navigation controller
CATransition *transition = [CATransition animation];
transition.duration = 0.5f;
transition.timingFunction = [CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
[self.navigationController.view.layer addAnimation:transition
forKey:nil]; 

    // tell the navigator to run the action
[[TTNavigator navigator] openURLAction:urlAction];

, - !

+6

TTNavigator TTLauncherView :

- (void)launcherView:(TTLauncherView*)launcher didSelectItem:(TTLauncherItem*)item {
    TTURLAction* action = [TTURLAction actionWithURLPath:item.URL];
    [action setAnimated:YES];
    [action setTransition:UIViewAnimationTransitionFlipFromLeft];
    [[TTNavigator navigator] openURLAction:action];
}

TTNavigator URL.

+1

Source: https://habr.com/ru/post/1761067/


All Articles