0

I want to make a transition, that in the end, the ToViewController alpha value will be something like 0.7, so the user still be able to see the FromViewController" at the background.

Why am I doing it? because at the end of transition I need to remove the FromViewController.

Ganesh Somani
  • 2,280
  • 2
  • 28
  • 37
Daniel Rahamim
  • 285
  • 2
  • 18

1 Answers1

1

An easy way is to take snapshot of the view controller at run time and navigate your desired controller with passing snapshot image and make it a background image of ToView Controller, so it will look like you are on a same page.

-(UIImage *)takeSnapshot:(UIView *)snapView {

    UIGraphicsBeginImageContextWithOptions(snapView.frame.size, NO, [UIScreen mainScreen].scale);

    [snapView drawViewHierarchyInRect:snapView.bounds afterScreenUpdates:NO];

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
Rohit Jha
  • 21
  • 3