HWPanModalPresenterProtocol.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // HWPanModalPresenterProtocol.h
  3. // Pods
  4. //
  5. // Created by heath wang on 2019/4/29.
  6. //
  7. #import <UIKit/UIKit.h>
  8. #import <Foundation/Foundation.h>
  9. #import <HWPanModal/HWPanModalPresentable.h>
  10. @class HWPanModalPresentationDelegate;
  11. NS_ASSUME_NONNULL_BEGIN
  12. @protocol HWPanModalPresenter <NSObject>
  13. @property (nonatomic, assign, readonly) BOOL isPanModalPresented;
  14. /**
  15. * 这里我们将实现UIViewControllerTransitioningDelegate协议的delegate通过runtime存入到viewControllerToPresent中。
  16. * use runtime to store this prop to hw_presentedVC
  17. */
  18. @property (nonnull, nonatomic, strong) HWPanModalPresentationDelegate *hw_panModalPresentationDelegate;
  19. /**
  20. * Note: This method ONLY for iPad, like UIPopoverPresentationController.
  21. */
  22. - (void)presentPanModal:(UIViewController<HWPanModalPresentable> *)viewControllerToPresent
  23. sourceView:(nullable UIView *)sourceView
  24. sourceRect:(CGRect)rect;
  25. - (void)presentPanModal:(UIViewController<HWPanModalPresentable> *)viewControllerToPresent
  26. sourceView:(nullable UIView *)sourceView
  27. sourceRect:(CGRect)rect
  28. completion:(void (^ __nullable)(void))completion;
  29. /**
  30. * Present the Controller from bottom.
  31. */
  32. - (void)presentPanModal:(UIViewController<HWPanModalPresentable> *)viewControllerToPresent;
  33. - (void)presentPanModal:(UIViewController<HWPanModalPresentable> *)viewControllerToPresent
  34. completion:(void (^ __nullable)(void))completion;
  35. @end
  36. NS_ASSUME_NONNULL_END