react-native-navigation的迁移库

RNNModalManager.h 1.3KB

1234567891011121314151617181920212223242526272829
  1. #import <Foundation/Foundation.h>
  2. #import <UIKit/UIKit.h>
  3. #import <React/RCTBridge.h>
  4. typedef void (^RNNTransitionCompletionBlock)(void);
  5. typedef void (^RNNTransitionWithComponentIdCompletionBlock)(NSString * _Nonnull componentId);
  6. typedef void (^RNNTransitionRejectionBlock)(NSString * _Nonnull code, NSString * _Nonnull message, NSError * _Nullable error);
  7. @protocol RNNModalManagerDelegate <NSObject>
  8. - (void)dismissedModal:(UIViewController * _Nonnull)viewController;
  9. - (void)attemptedToDismissModal:(UIViewController * _Nonnull)viewController;
  10. - (void)dismissedMultipleModals:(NSArray * _Nonnull)viewControllers;
  11. @end
  12. @interface RNNModalManager : NSObject <UIAdaptivePresentationControllerDelegate>
  13. - (instancetype _Nullable)initWithBridge:(RCTBridge * _Nonnull)bridge;
  14. @property (nonatomic, weak) id<RNNModalManagerDelegate> _Nullable delegate;
  15. - (void)showModal:(UIViewController * _Nonnull)viewController animated:(BOOL)animated completion:(RNNTransitionWithComponentIdCompletionBlock _Nonnull)completion;
  16. - (void)dismissModal:(UIViewController * _Nonnull)viewController completion:(RNNTransitionCompletionBlock _Nonnull)completion;
  17. - (void)dismissAllModalsAnimated:(BOOL)animated completion:(void (^ __nullable)(void))completion;
  18. - (void)dismissAllModalsSynchronosly;
  19. @end