File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -90,3 +90,45 @@ - (void)rta_displayLayer:(CALayer *)layer
90
90
@end
91
91
92
92
#endif // !TARGET_OS_OSX && REACT_NATIVE_VERSION < 6302
93
+
94
+ // MARK: - [0.70.0] Alerts don't show when using UIScene
95
+ // See https://github.com/facebook/react-native/pull/34562
96
+
97
+ #if !TARGET_OS_OSX && REACT_NATIVE_VERSION < 7100
98
+
99
+ #import < React/RCTAlertController.h>
100
+ #import < React/RCTUtils.h>
101
+
102
+ @implementation RCTAlertController (ReactTestApp)
103
+
104
+ + (void )initialize
105
+ {
106
+ if ([self class ] != [RCTAlertController class ]) {
107
+ return ;
108
+ }
109
+
110
+ if (@available (iOS 13.0 , *)) {
111
+ static dispatch_once_t onceToken;
112
+ dispatch_once (&onceToken, ^{
113
+ RTASwizzleSelector ([self class ], @selector (hide ), @selector (rta_hide ));
114
+ RTASwizzleSelector (
115
+ [self class ], @selector (show:completion: ), @selector (rta_show:completion: ));
116
+ });
117
+ }
118
+ }
119
+
120
+ - (void )rta_hide
121
+ {
122
+ // noop
123
+ }
124
+
125
+ - (void )rta_show : (BOOL )animated completion : (void (^)(void ))completion
126
+ {
127
+ [[RCTKeyWindow () rootViewController ] presentViewController: self
128
+ animated: animated
129
+ completion: completion];
130
+ }
131
+
132
+ @end
133
+
134
+ #endif // !TARGET_OS_OSX && REACT_NATIVE_VERSION < 7100
You can’t perform that action at this time.
0 commit comments