RCTModalHostViewManager.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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/RCTConvert.h>
  8. #import <React/RCTInvalidating.h>
  9. #import <React/RCTViewManager.h>
  10. @interface RCTConvert (RCTModalHostView)
  11. + (UIModalPresentationStyle)UIModalPresentationStyle:(id)json;
  12. @end
  13. typedef void (^RCTModalViewInteractionBlock)(
  14. UIViewController *reactViewController,
  15. UIViewController *viewController,
  16. BOOL animated,
  17. dispatch_block_t completionBlock);
  18. @interface RCTModalHostViewManager : RCTViewManager <RCTInvalidating>
  19. /**
  20. * `presentationBlock` and `dismissalBlock` allow you to control how a Modal interacts with your case,
  21. * e.g. in case you have a native navigator that has its own way to display a modal.
  22. * If these are not specified, it falls back to the UIViewController standard way of presenting.
  23. */
  24. @property (nonatomic, strong) RCTModalViewInteractionBlock presentationBlock;
  25. @property (nonatomic, strong) RCTModalViewInteractionBlock dismissalBlock;
  26. @end