Stian Høiland
Stian Høiland

Reputation: 3664

How to animate a view from top to bottom and stacking that view properly?

I want to, as properly as possible, animate a view from top to bottom. Then do the appropriate magic to handle memory allocations and such.

In other words, I want an inverse

UIModalTransitionStyleCoverVertical

This modalTransitionStyle pops the view up from bottom, while what I'd like it to do is arrive by airplane.

I've looked into some black magic CATransition, but I can't for the life of me find a proper way of handling memory and dismissing (or "popping off") the view with this method.

A solution as close to "as Steve Jobs intended" is much preferred.

PS: The solution does not need to deal with the view as modal. Actually dealing with it as a new "card" on the stack would be best.

Upvotes: 1

Views: 1706

Answers (1)

Marcelo Alves
Marcelo Alves

Reputation: 1846

How about UIView
+ (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion

or

+ (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion

Upvotes: 1

Related Questions