Skip to content

Instantly share code, notes, and snippets.

@saiday
Created June 15, 2015 10:09
Show Gist options
  • Select an option

  • Save saiday/9d0b73f86fd61645b3fe to your computer and use it in GitHub Desktop.

Select an option

Save saiday/9d0b73f86fd61645b3fe to your computer and use it in GitHub Desktop.
BaseAnimator
#import "BaseAnimator.h"
@implementation BaseAnimator
- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext
{
UIViewController *to = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
UIViewController *from = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
if (self.transitionType == ModalAnimatedTransitioningTypePresent) {
[self animatePresentingInContext:transitionContext toVC:to fromVC:from];
} else if (self.transitionType == ModalAnimatedTransitioningTypeDismiss) {
[self animateDismissingInContext:transitionContext toVC:to fromVC:from];
}
}
- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext
{
mustOverride();
}
- (void)animatePresentingInContext:(id<UIViewControllerContextTransitioning>)transitionContext toVC:(UIViewController *)toVC fromVC:(UIViewController *)fromVC
{
mustOverride();
}
- (void)animateDismissingInContext:(id<UIViewControllerContextTransitioning>)transitionContext toVC:(UIViewController *)toVC fromVC:(UIViewController *)fromVC
{
mustOverride();
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment