0

I'm trying to use iOS7's custom transitions in order to let the user navigate between view controllers through a kind of 'pan' effect.

As depicted here:

enter image description here

I need the background pattern to continue also outside the vc's bounds, so that when the user moves from vc1 to vc2 all the background visible between the vcs translates too.

Any hint is really appreciated.

Thanks, DAN

DAN
  • 919
  • 1
  • 6
  • 23

1 Answers1

1

Have a large UIImageView with the image in the transitionContext.containerView, and change its origin as the pan gesture progresses?

rounak
  • 9,217
  • 3
  • 42
  • 59
  • Awesome, it seems to work brilliantly! Is it correct to add the UIImageView in the animateTransition:(id)transitionContext method, as it is called when the animation starts, or there is an initialization point for the transitionContext object? – DAN Mar 31 '14 at 16:18
  • @DAN Yes that's the method where all your animation code goes. And if the answer works, you should accept it :) – rounak Mar 31 '14 at 19:30
  • Thanks perfect, my only concern was about allocating an object and adding it as a subview in a method which is called when the user interaction begins; I hope it does not slow down the transition. – DAN Mar 31 '14 at 20:19
  • I do plenty of object creation in my transition animation code. Animations still work smoothly. – rounak Mar 31 '14 at 20:22