0

I have a UITableViewController, inside my UITableViewCell i have an imageView when the user taps on it, i present it modally using my own custom UIViewControllerContextTransitioning to make a zoom effect on it, it works like a charm the problem is that when the animation completes and i call the

[transitionContext completeTransition:YES];

My UITableView which is now behind my Modal UIViewController is removed form the view hierarchy so i got a black screen behind it

 [containerView addSubview:toViewController.view];
 [UIView animateWithDuration:duration delay:0.0 usingSpringWithDamping:damping initialSpringVelocity:1.0 / damping options:0 animations:^{
    // blablabla animation stuff
 } completion:^(BOOL finished) {
   [transitionContext completeTransition:YES];// this line makes my UITableView removed form the view hierarchy 
 }];

Here is what i've tried so far :

add in the completion bloc the UITableView

  [[UIApplication sharedApplication ].keyWindow insertSubview:fromViewController.view belowSubview:containerView];

But this only works on iOS8 ...

Any ideas how to fix this ? thank you !!

mahieddine
  • 510
  • 4
  • 14

1 Answers1

0

Try to set modalPresentationStyle of the presenting view controller to UIModalPresentationCustom

hsafarya
  • 993
  • 9
  • 21