RCTModalHostViewManager.h 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <React/RCTInvalidating.h>
  8. #import <React/RCTViewManager.h>
  9. #import <React/RCTConvert.h>
  10. @interface RCTConvert (RCTModalHostView)
  11. + (UIModalPresentationStyle)UIModalPresentationStyle:(id)json;
  12. @end
  13. typedef void (^RCTModalViewInteractionBlock)(UIViewController *reactViewController, UIViewController *viewController, BOOL animated, dispatch_block_t completionBlock);
  14. @interface RCTModalHostViewManager : RCTViewManager <RCTInvalidating>
  15. /**
  16. * `presentationBlock` and `dismissalBlock` allow you to control how a Modal interacts with your case,
  17. * e.g. in case you have a native navigator that has its own way to display a modal.
  18. * If these are not specified, it falls back to the UIViewController standard way of presenting.
  19. */
  20. @property (nonatomic, strong) RCTModalViewInteractionBlock presentationBlock;
  21. @property (nonatomic, strong) RCTModalViewInteractionBlock dismissalBlock;
  22. @end