@@ -25,7 +25,9 @@ @implementation RCTModalHostView {
2525 RCTModalHostViewController *_modalViewController;
2626 RCTTouchHandler *_touchHandler;
2727 UIView *_reactSubview;
28+ #if !TARGET_OS_TV
2829 UIInterfaceOrientation _lastKnownOrientation;
30+ #endif
2931 RCTDirectEventBlock _onRequestClose;
3032}
3133
@@ -90,6 +92,7 @@ - (void)presentationControllerDidDismiss:(UIPresentationController *)presentatio
9092
9193- (void )notifyForOrientationChange
9294{
95+ #if !TARGET_OS_TV
9396 if (!_onOrientationChange) {
9497 return ;
9598 }
@@ -106,6 +109,7 @@ - (void)notifyForOrientationChange
106109 @" orientation" : isPortrait ? @" portrait" : @" landscape" ,
107110 };
108111 _onOrientationChange (eventPayload);
112+ #endif
109113}
110114
111115- (void )insertReactSubview : (UIView *)subview atIndex : (NSInteger )atIndex
@@ -191,7 +195,9 @@ - (void)ensurePresentedOnlyIfNeeded
191195 if (shouldBePresented) {
192196 RCTAssert (self.reactViewController , @" Can't present modal view controller without a presenting view controller" );
193197
198+ #if !TARGET_OS_TV
194199 _modalViewController.supportedInterfaceOrientations = [self supportedOrientationsMask ];
200+ #endif
195201
196202 if ([self .animationType isEqualToString: @" fade" ]) {
197203 _modalViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
@@ -224,6 +230,7 @@ - (void)setTransparent:(BOOL)transparent
224230 transparent ? UIModalPresentationOverFullScreen : UIModalPresentationFullScreen;
225231}
226232
233+ #if !TARGET_OS_TV
227234- (UIInterfaceOrientationMask)supportedOrientationsMask
228235{
229236 if (_supportedOrientations.count == 0 ) {
@@ -250,6 +257,7 @@ - (UIInterfaceOrientationMask)supportedOrientationsMask
250257 }
251258 return supportedOrientations;
252259}
260+ #endif
253261
254262@end
255263
0 commit comments