Search code examples
iphonecore-animation

How can I switch Content Views with an water-effect transition?


In the Photos app, there is a nice water drop effect used for transition. I had seen an app a while ago that used this same water effect transition for it's content views.

Unfortunately, this transition type is not listed in the UIViewAnimationTransition documentation. But since this third party app used it (I don't remember it's name), I guess that there is a way of using it.

Does anyone know?


Solution

  • I think it's just a hidden CATransition type:

    CATransition *transition = [CATransition animation];
    transition.type = @"rippleEffect";
    transition.duration = 5.0f;
    transition.timingFunction = UIViewAnimationCurveEaseInOut;
    [self.layer addAnimation:transition forKey:@"transitionViewAnimation"];
    

    (Note: I haven't tried this for rippleEffect but I have used suckEffect and spewEffect similarly)