Skip to content
Merged
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
42 changes: 42 additions & 0 deletions ios/ReactTestApp/React+Compatibility.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,45 @@ - (void)rta_displayLayer:(CALayer *)layer
@end

#endif // !TARGET_OS_OSX && REACT_NATIVE_VERSION < 6302

// MARK: - [0.70.0] Alerts don't show when using UIScene
// See https://github.com/facebook/react-native/pull/34562

#if !TARGET_OS_OSX && REACT_NATIVE_VERSION < 7100

#import <React/RCTAlertController.h>
#import <React/RCTUtils.h>

@implementation RCTAlertController (ReactTestApp)

+ (void)initialize
{
if ([self class] != [RCTAlertController class]) {
return;
}

if (@available(iOS 13.0, *)) {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
RTASwizzleSelector([self class], @selector(hide), @selector(rta_hide));
RTASwizzleSelector(
[self class], @selector(show:completion:), @selector(rta_show:completion:));
});
}
}

- (void)rta_hide
{
// noop
}

- (void)rta_show:(BOOL)animated completion:(void (^)(void))completion
{
[[RCTKeyWindow() rootViewController] presentViewController:self
animated:animated
completion:completion];
}

@end

#endif // !TARGET_OS_OSX && REACT_NATIVE_VERSION < 7100