Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: RCTConvert to support UIModalPresentationStyle #43297

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/react-native/React/Base/RCTConvert.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ typedef NSURL RCTFileURL;
+ (UIReturnKeyType)UIReturnKeyType:(id)json;
+ (UIUserInterfaceStyle)UIUserInterfaceStyle:(id)json API_AVAILABLE(ios(12));
+ (UIInterfaceOrientationMask)UIInterfaceOrientationMask:(NSString *)orientation;
+ (UIModalPresentationStyle)UIModalPresentationStyle:(id)json;

#if !TARGET_OS_TV
+ (UIDataDetectorTypes)UIDataDetectorTypes:(id)json;
Expand Down
11 changes: 11 additions & 0 deletions packages/react-native/React/Base/RCTConvert.mm
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,17 @@ + (UIKeyboardType)UIKeyboardType:(id)json RCT_DYNAMIC
NSNotFound,
unsignedIntegerValue)

RCT_ENUM_CONVERTER(
UIModalPresentationStyle,
(@{
@"fullScreen" : @(UIModalPresentationFullScreen),
@"pageSheet" : @(UIModalPresentationPageSheet),
@"formSheet" : @(UIModalPresentationFormSheet),
@"overFullScreen" : @(UIModalPresentationOverFullScreen),
}),
UIModalPresentationFullScreen,
integerValue)

RCT_ENUM_CONVERTER(
UIViewContentMode,
(@{
Expand Down
6 changes: 0 additions & 6 deletions packages/react-native/React/Views/RCTModalHostViewManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
#import <React/RCTInvalidating.h>
#import <React/RCTViewManager.h>

@interface RCTConvert (RCTModalHostView)

+ (UIModalPresentationStyle)UIModalPresentationStyle:(id)json;

@end

typedef void (^RCTModalViewInteractionBlock)(
UIViewController *reactViewController,
UIViewController *viewController,
Expand Down
15 changes: 0 additions & 15 deletions packages/react-native/React/Views/RCTModalHostViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@
#import "RCTShadowView.h"
#import "RCTUtils.h"

@implementation RCTConvert (RCTModalHostView)

RCT_ENUM_CONVERTER(
UIModalPresentationStyle,
(@{
@"fullScreen" : @(UIModalPresentationFullScreen),
@"pageSheet" : @(UIModalPresentationPageSheet),
@"formSheet" : @(UIModalPresentationFormSheet),
@"overFullScreen" : @(UIModalPresentationOverFullScreen),
}),
UIModalPresentationFullScreen,
integerValue)

@end

@interface RCTModalHostShadowView : RCTShadowView

@end
Expand Down
Loading