How to pass view to another controller while custom push and pop animation in ios?

625 views Asked by At

I'm using custom transition, UIViewControllerAnimatedTransitioning. I've been able to animate whole controllers for push and pop.
But I need another thing: shrink some header view and stretch selected table cell and add some text to stretched cell. That will be my pushed controller.

How can I achieve this, when part of my pushed controller is coming from storyboard and another part from previous controller?

Can't find any tutorial for this. Only how to animate whole controllers.

upd:
I've seen this answer: https://stackoverflow.com/a/23580502/1400119 but it's not helped me a lot.

upd2:
finally achieved the goal. Here is links to blogposts and repos that helped me a lot, maybe they will help someone too:
UINavigationControllerDelegate apple doc
UIViewControllerContextTransitioning apple doc

How to animate image in tableview to extend and open another view controller simultaneously?
Navigation controller custom transition animation

http://captechconsulting.com/blog/tyler-tillage/ios-7-tutorial-series-custom-navigation-transitions-more http://dativestudios.com/blog/2013/09/29/interactive-transitions/
http://www.objc.io/issue-12/custom-container-view-controller-transitions.html

https://github.com/mariohahn/MHVideoPhotoGallery

1

There are 1 answers

3
Federica Venuto On BEST ANSWER

Use the animation on the table cell. Like i've done for the collection view in the following example.

 [UIView animateWithDuration:.1 delay:0.0 options:UIViewAnimationOptionCurveLinear animations:^{
            [_collectionView setAlpha:1];
        }
        completion:^(BOOL finished) {
            [UIView animateWithDuration:.5 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^{
                _collectionView.center = CGPointMake(160, 528);

            }
            completion:^(BOOL finished) {
            }];
        }];