Question

I am trying to create a custom iOS 7 Transition. At present I have a simple circle view like this: enter image description here

I have a gesture recogniser on the custom view. When clicked the custom transition delegate is called

`-[CCZTTransitionDelegate animationControllerForPresentedController:presentingController:sourceController:]`  

Which in turn calls the two methods on the transition animating class:

-[CCZTAnimatedTransitioning transitionDuration:]
-[CCZTAnimatedTransitioning animateTransition:]

At present I have just made the second controller zoom in and that is all working fine...

Desired Effect
What I would like to do when the circle is tapped is
1. have the circle increase in size until the screen is completed covered with its color.
2. Fade the second controller in

What is the best way to complete step 1? Can this be completed in the transition delegate/transition animating methods?

In this method - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext it looks like I have access to the view controllers but not the subview. Should the animation be done before somehow if so how?

Note: In time there will eventually be a group of the circles not just one.

EDIT:
It is also important to note that I am actually trying to zoom in from the center of the circle. So if the circle is positioned elsewhere (i.e. when there are more) the circle should zoom in/increase in size from its own center point.

Was it helpful?

Solution

Try using a CGAffineTransformScale animation on the circle view and expand it to fill the entire view. Once that is done scaling up (either through the UIView animation completion block or by using UIViewKeyFrameAnimation), present your next view controller behind the filled in view. Once presented, fade out the view to reveal the newly presented view controller by alpha-ing down the view in an animation block.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top