省钱达人

TYBaseAnimation.h 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // TYBaseAnimation.h
  3. // TYAlertControllerDemo
  4. //
  5. // Created by SunYong on 15/9/1.
  6. // Copyright (c) 2015年 tanyang. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "TYAlertController.h"
  10. @interface TYBaseAnimation : NSObject<UIViewControllerAnimatedTransitioning>
  11. @property (nonatomic, assign, readonly) BOOL isPresenting; // present . dismiss
  12. + (instancetype)alertAnimationIsPresenting:(BOOL)isPresenting;
  13. // if you only want alert or actionsheet style ,you can judge that you don't need and return nil
  14. // code : only support alert style
  15. // if (preferredStyle == TYAlertControllerStyleAlert) {
  16. // return [super alertAnimationIsPresenting:isPresenting];
  17. // }
  18. // return nil;
  19. + (instancetype)alertAnimationIsPresenting:(BOOL)isPresenting preferredStyle:(TYAlertControllerStyle) preferredStyle;
  20. // override transiton time
  21. - (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext;
  22. // override present
  23. - (void)presentAnimateTransition:(id<UIViewControllerContextTransitioning>)transitionContext;
  24. // override dismiss
  25. - (void)dismissAnimateTransition:(id<UIViewControllerContextTransitioning>)transitionContext;
  26. @end