RQNavigationProtocol.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // RQNavigationProtocol.h
  3. // RQCommon
  4. //
  5. // Created by 张嵘 on 2018/11/16.
  6. // Copyright © 2018 张嵘. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "RQConstant.h"
  10. @class RQBaseViewModel;
  11. @protocol RQNavigationProtocol <NSObject>
  12. /// Pushes the corresponding view controller.
  13. ///
  14. /// Uses a horizontal slide transition.
  15. /// Has no effect if the corresponding view controller is already in the stack.
  16. ///
  17. /// viewModel - the view model
  18. /// animated - use animation or not
  19. - (void)pushViewModel:(RQBaseViewModel *)viewModel animated:(BOOL)animated;
  20. /// Pops the top view controller in the stack.
  21. ///
  22. /// animated - use animation or not
  23. - (void)popViewModelAnimated:(BOOL)animated;
  24. /// Pops until there's only a single view controller left on the stack.
  25. ///
  26. /// animated - use animation or not
  27. - (void)popToRootViewModelAnimated:(BOOL)animated;
  28. /// Present the corresponding view controller.
  29. ///
  30. /// viewModel - the view model
  31. /// animated - use animation or not
  32. /// completion - the completion handler
  33. - (void)presentViewModel:(RQBaseViewModel *)viewModel animated:(BOOL)animated completion:(VoidBlock)completion;
  34. /// Dismiss the presented view controller.
  35. ///
  36. /// animated - use animation or not
  37. /// completion - the completion handler
  38. - (void)dismissViewModelAnimated:(BOOL)animated completion:(VoidBlock)completion;
  39. /// Reset the corresponding view controller as the root view controller of the application's window.
  40. ///
  41. /// viewModel - the view model
  42. - (void)resetRootViewModel:(RQBaseViewModel *)viewModel;
  43. @end