Closed y0unghe closed 9 years ago
Hi @y0unghe
the collection view cell is not init yet, so there is no way the animation will work.
That's right.
So, how to call transitionDestinationImageViewFrame after the collection view controller finished reload data, for example cellForItemAtIndexPath.
I think you can use RMPZoomTransitionDelegate
. Please read the following document.
/**
Delegate handler of viewController which implements transitioning protocol
*/
@protocol RMPZoomTransitionDelegate <NSObject>
@optional
/**
Notify the end of the forward and backward animations.
get the original UIImageView and hide it, while the copy is being animated.
And when the animation is done, the original could be shown.
That will prevent the original views to be shown while animating.
*/
- (void)zoomTransitionAnimator:(RMPZoomTransitionAnimator *)animator
didCompleteTransition:(BOOL)didComplete
animatingSourceImageView:(UIImageView *)imageView;
@end
I have a collection view controller, and it's datasource come from a view controller that push it. Every time I push this collection view controller, it's datasource will get reloaded. I set two breakpoints to
cellForItemAtIndexPath
andtransitionDestinationImageViewFrame
. The first function get called istransitionDestinationImageViewFrame
and thencellForItemAtIndexPath
. When it's intransitionDestinationImageViewFrame
, the collection view cell is not init yet, so there is no way the animation will work. So, how to call transitionDestinationImageViewFrame after the collection view controller finished reload data, for example cellForItemAtIndexPath.