react-native-navigation的迁移库

TheSidebarController.h 4.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // TheSidebarController.h
  2. // TheSidebarController
  3. //
  4. // Copyright (c) 2013 Jon Danao (danao.org | jondanao)
  5. //
  6. // Permission is hereby granted, free of charge, to any person obtaining a copy
  7. // of this software and associated documentation files (the "Software"), to deal
  8. // in the Software without restriction, including without limitation the rights
  9. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. // copies of the Software, and to permit persons to whom the Software is
  11. // furnished to do so, subject to the following conditions:
  12. //
  13. // The above copyright notice and this permission notice shall be included in
  14. // all copies or substantial portions of the Software.
  15. //
  16. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. // THE SOFTWARE.
  23. #import <UIKit/UIKit.h>
  24. #import "Animations/SidebarAnimation.h"
  25. @protocol TheSidebarControllerDelegate;
  26. @interface TheSidebarController : UIViewController
  27. @property (strong, nonatomic) UIViewController *contentViewController;
  28. @property (strong, nonatomic) UIViewController *leftSidebarViewController;
  29. @property (strong, nonatomic) UIViewController *rightSidebarViewController;
  30. @property (assign, nonatomic) NSTimeInterval animationDuration;
  31. @property (assign, nonatomic) CGFloat visibleWidth;
  32. @property (assign, nonatomic) BOOL sidebarIsPresenting;
  33. @property (assign, nonatomic) id<TheSidebarControllerDelegate> delegate;
  34. @property (assign, nonatomic) BOOL storyboardsUseAutolayout;
  35. @property (nonatomic, strong) UIColor *overlayContentColor;
  36. - (id)initWithContentViewController:(UIViewController *)contentViewController
  37. leftSidebarViewController:(UIViewController *)leftSidebarViewController;
  38. - (id)initWithContentViewController:(UIViewController *)contentViewController
  39. rightSidebarViewController:(UIViewController *)rightSidebarViewController;
  40. - (id)initWithContentViewController:(UIViewController *)contentViewController
  41. leftSidebarViewController:(UIViewController *)leftSidebarViewController
  42. rightSidebarViewController:(UIViewController *)rightSidebarViewController;
  43. - (id)initWithContentViewController:(UIViewController *)contentViewController
  44. leftSidebarViewController:(UIViewController *)leftSidebarViewController
  45. storyboardsUseAutoLayout:(BOOL)storyboardsUseAutoLayout;
  46. - (id)initWithContentViewController:(UIViewController *)contentViewController
  47. rightSidebarViewController:(UIViewController *)rightSidebarViewController
  48. storyboardsUseAutoLayout:(BOOL)storyboardsUseAutoLayout;
  49. - (id)initWithContentViewController:(UIViewController *)contentViewController
  50. leftSidebarViewController:(UIViewController *)leftSidebarViewController
  51. rightSidebarViewController:(UIViewController *)rightSidebarViewController
  52. storyboardsUseAutoLayout:(BOOL)storyboardsUseAutoLayout;
  53. - (void)dismissSidebarViewController;
  54. - (void)presentLeftSidebarViewController;
  55. - (void)presentLeftSidebarViewControllerWithStyle:(SidebarTransitionStyle)transitionStyle;
  56. - (void)presentRightSidebarViewController;
  57. - (void)presentRightSidebarViewControllerWithStyle:(SidebarTransitionStyle)transitionStyle;
  58. @end
  59. @protocol TheSidebarControllerDelegate <NSObject>
  60. @optional
  61. - (void)sidebarController:(TheSidebarController *)sidebarController willShowViewController:(UIViewController *)viewController;
  62. - (void)sidebarController:(TheSidebarController *)sidebarController didShowViewController:(UIViewController *)viewController;
  63. - (void)sidebarController:(TheSidebarController *)sidebarController willHideViewController:(UIViewController *)viewController;
  64. - (void)sidebarController:(TheSidebarController *)sidebarController didHideViewController:(UIViewController *)viewController;
  65. @end
  66. @interface UIViewController(TheSidebarController)
  67. @property (strong, readonly, nonatomic) TheSidebarController *sidebarController;
  68. @end