猎豆优选

UIView+TYAlertView.h 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // UIView+TYAlertView.h
  3. // TYAlertControllerDemo
  4. //
  5. // Created by tanyang on 15/9/7.
  6. // Copyright (c) 2015年 tanyang. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "TYAlertController.h"
  10. #import "TYShowAlertView.h"
  11. @interface UIView (TYAlertView)
  12. + (instancetype)createViewFromNib;
  13. + (instancetype)createViewFromNibName:(NSString *)nibName;
  14. - (UIViewController*)viewController;
  15. #pragma mark - show in controller
  16. - (void)showInController:(UIViewController *)viewController;
  17. - (void)showInController:(UIViewController *)viewController preferredStyle:(TYAlertControllerStyle)preferredStyle;
  18. // backgoundTapDismissEnable default NO
  19. - (void)showInController:(UIViewController *)viewController preferredStyle:(TYAlertControllerStyle)preferredStyle backgoundTapDismissEnable:(BOOL)backgoundTapDismissEnable;
  20. - (void)showInController:(UIViewController *)viewController preferredStyle:(TYAlertControllerStyle)preferredStyle transitionAnimation:(TYAlertTransitionAnimation)transitionAnimation;
  21. - (void)showInController:(UIViewController *)viewController preferredStyle:(TYAlertControllerStyle)preferredStyle transitionAnimation:(TYAlertTransitionAnimation)transitionAnimation backgoundTapDismissEnable:(BOOL)backgoundTapDismissEnable;
  22. #pragma mark - show in window
  23. - (void)showInWindow;
  24. // backgoundTapDismissEnable default NO
  25. - (void)showInWindowWithBackgoundTapDismissEnable:(BOOL)backgoundTapDismissEnable;
  26. - (void)showInWindowWithOriginY:(CGFloat)OriginY;
  27. - (void)showInWindowWithOriginY:(CGFloat)OriginY backgoundTapDismissEnable:(BOOL)backgoundTapDismissEnable;
  28. #pragma mark - hide
  29. // this will judge and call right method
  30. - (void)hideView;
  31. - (void)hideInController;
  32. - (void)hideInWindow;
  33. @end