react-native-navigation的迁移库

RCTConvert+Modal.h 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #import <React/RCTConvert.h>
  2. @interface RCTConvert (Modal)
  3. + (UIModalPresentationStyle)defaultModalPresentationStyle;
  4. @end
  5. @implementation RCTConvert (Modal)
  6. + (UIModalPresentationStyle)defaultModalPresentationStyle {
  7. if (@available(iOS 13.0, *)) {
  8. return UIModalPresentationAutomatic;
  9. } else {
  10. return UIModalPresentationOverFullScreen;
  11. }
  12. }
  13. RCT_ENUM_CONVERTER(UIModalTransitionStyle,
  14. (@{@"coverVertical": @(UIModalTransitionStyleCoverVertical),
  15. @"flipHorizontal": @(UIModalTransitionStyleFlipHorizontal),
  16. @"crossDissolve": @(UIModalTransitionStyleCrossDissolve),
  17. @"partialCurl": @(UIModalTransitionStylePartialCurl)
  18. }), UIModalTransitionStyleCoverVertical, integerValue)
  19. RCT_ENUM_CONVERTER(UIModalPresentationStyle,
  20. (@{@"fullScreen": @(UIModalPresentationFullScreen),
  21. @"pageSheet": @(UIModalPresentationPageSheet),
  22. @"formSheet": @(UIModalPresentationFormSheet),
  23. @"currentContext": @(UIModalPresentationCurrentContext),
  24. @"custom": @(UIModalPresentationCustom),
  25. @"overFullScreen": @(UIModalPresentationOverFullScreen),
  26. @"overCurrentContext": @(UIModalPresentationOverCurrentContext),
  27. @"popover": @(UIModalPresentationPopover),
  28. @"none": @(UIModalPresentationNone),
  29. @"default": @([RCTConvert defaultModalPresentationStyle])
  30. }), UIModalPresentationFullScreen, integerValue)
  31. @end