HWPanModalPresentationUpdateProtocol.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // HWPanModalPresentationUpdateProtocol.h
  3. // Pods
  4. //
  5. // Created by heath wang on 2019/10/17.
  6. //
  7. #import <HWPanModal/HWPanModalPresentable.h>
  8. @class HWDimmedView;
  9. @protocol HWPanModalPresentationUpdateProtocol <NSObject>
  10. /// background view, you can call `reloadConfig:` to update the UI.
  11. @property (nonatomic, readonly) HWDimmedView *hw_dimmedView;
  12. /// the root container which your custom VC's view to be added.
  13. @property (nonatomic, readonly) UIView *hw_rootContainerView;
  14. /// which view that your presented viewController's view has been added.
  15. @property (nonatomic, readonly) UIView *hw_contentView;
  16. /// current presentation State
  17. @property (nonatomic, readonly) PresentationState hw_presentationState;
  18. /**
  19. * force update pan modal State, short/long
  20. */
  21. - (void)hw_panModalTransitionTo:(PresentationState)state NS_SWIFT_NAME(panModalTransitionTo(state:));
  22. /**
  23. * force update pan modal State, short/long
  24. * @param state transition state
  25. * @param animated whether animate when set state
  26. */
  27. - (void)hw_panModalTransitionTo:(PresentationState)state animated:(BOOL)animated NS_SWIFT_NAME(panModalTransitionTo(state:animated:));
  28. /**
  29. * When presented ViewController has a UIScrollView, Use This method to update UIScrollView contentOffset
  30. * Default it has animation
  31. */
  32. - (void)hw_panModalSetContentOffset:(CGPoint)offset NS_SWIFT_NAME(panModalSetContentOffset(offset:));
  33. /**
  34. * When presented ViewController has a UIScrollView, Use This method to update UIScrollView contentOffset
  35. * @param offset scrollView offset value
  36. * @param animated whether animate
  37. */
  38. - (void)hw_panModalSetContentOffset:(CGPoint)offset animated:(BOOL)animated NS_SWIFT_NAME(panModalSetContentOffset(offset:animated:));
  39. /**
  40. * Note:if we present a NavigationController, and we want to pan screen edge to dismiss.
  41. * We MUST call this method when we PUSH/POP viewController.
  42. *
  43. */
  44. - (void)hw_panModalSetNeedsLayoutUpdate NS_SWIFT_NAME(panModalSetNeedsLayoutUpdate());
  45. /**
  46. * When you change the user touch event, like `allowsTouchEventsPassingThroughTransitionView`, you should call this method to make it work.
  47. * 更新用户行为,比如事件穿透
  48. */
  49. - (void)hw_panModalUpdateUserHitBehavior NS_SWIFT_NAME(panModalUpdateUserHitBehavior());
  50. /**
  51. * call this method to dismiss your presented VC directly
  52. */
  53. - (void)hw_dismissAnimated:(BOOL)animated completion:(void (^)(void))completion NS_SWIFT_NAME(dismissAnimated(animated:completion:));
  54. @end