diff --git a/packages/react-native/React/CoreModules/RCTLogBoxView.mm b/packages/react-native/React/CoreModules/RCTLogBoxView.mm index 3b003a28a5dd..79f9aa288a4f 100644 --- a/packages/react-native/React/CoreModules/RCTLogBoxView.mm +++ b/packages/react-native/React/CoreModules/RCTLogBoxView.mm @@ -20,7 +20,9 @@ @implementation RCTLogBoxView { - (instancetype)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame]) != nullptr) { +#if !TARGET_OS_TV self.windowLevel = UIWindowLevelStatusBar - 1; +#endif self.backgroundColor = [UIColor clearColor]; } return self; @@ -40,7 +42,9 @@ - (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge { self = [super initWithWindowScene:window.windowScene]; +#if !TARGET_OS_TV self.windowLevel = UIWindowLevelStatusBar - 1; +#endif self.backgroundColor = [UIColor clearColor]; _surface = [[RCTSurface alloc] initWithBridge:bridge moduleName:@"LogBox" initialProperties:@{}]; diff --git a/packages/react-native/React/CoreModules/RCTRedBox.mm b/packages/react-native/React/CoreModules/RCTRedBox.mm index fb057b969214..f0dbb32bad1b 100644 --- a/packages/react-native/React/CoreModules/RCTRedBox.mm +++ b/packages/react-native/React/CoreModules/RCTRedBox.mm @@ -108,8 +108,10 @@ - (void)viewDidLoad _stackTraceTableView.delegate = self; _stackTraceTableView.dataSource = self; _stackTraceTableView.backgroundColor = [UIColor clearColor]; +#if !TARGET_OS_TV _stackTraceTableView.separatorColor = [UIColor colorWithWhite:1 alpha:0.3]; _stackTraceTableView.separatorStyle = UITableViewCellSeparatorStyleNone; +#endif _stackTraceTableView.indicatorStyle = UIScrollViewIndicatorStyleWhite; [self.view addSubview:_stackTraceTableView]; @@ -308,8 +310,10 @@ - (void)copyStack [fullStackTrace appendFormat:@" %@\n", [self formatFrameSource:stackFrame]]; } } +#if !TARGET_OS_TV UIPasteboard *pb = [UIPasteboard generalPasteboard]; [pb setString:fullStackTrace]; +#endif } - (NSString *)formatFrameSource:(RCTJSStackFrame *)stackFrame diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm index 9f1f29918a57..cde96f038792 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm @@ -43,7 +43,9 @@ @implementation RCTInputAccessoryComponentView { InputAccessoryShadowNode::ConcreteState::Shared _state; RCTInputAccessoryContentView *_contentView; +#if !TARGET_OS_TV RCTSurfaceTouchHandler *_touchHandler; +#endif UIView __weak *_textInput; } @@ -52,8 +54,10 @@ - (instancetype)initWithFrame:(CGRect)frame if (self = [super initWithFrame:frame]) { _props = InputAccessoryShadowNode::defaultSharedProps(); _contentView = [RCTInputAccessoryContentView new]; +#if !TARGET_OS_TV _touchHandler = [RCTSurfaceTouchHandler new]; [_touchHandler attachToView:_contentView]; +#endif } return self; diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm index 16b71e4d64ec..1a4339065e60 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm @@ -12,7 +12,9 @@ @implementation RCTFabricModalHostViewController { CGRect _lastViewBounds; +#if !TARGET_OS_TV RCTSurfaceTouchHandler *_touchHandler; +#endif } - (instancetype)init @@ -20,7 +22,9 @@ - (instancetype)init if ((self = [super init]) == nullptr) { return nil; } +#if !TARGET_OS_TV _touchHandler = [RCTSurfaceTouchHandler new]; +#endif return self; } @@ -37,7 +41,9 @@ - (void)viewDidLayoutSubviews - (void)loadView { self.view = [UIView new]; +#if !TARGET_OS_TV [_touchHandler attachToView:self.view]; +#endif } - (UIStatusBarStyle)preferredStatusBarStyle diff --git a/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm b/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm index d752d6ae56b7..fe00a0b3e951 100644 --- a/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm +++ b/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm @@ -15,6 +15,8 @@ #import "RCTConversions.h" #import "RCTTouchableComponentViewProtocol.h" +#if !TARGET_OS_TV + using namespace facebook::react; typedef NS_ENUM(NSInteger, RCTPointerEventType) { @@ -771,3 +773,5 @@ - (void)hovering:(UIHoverGestureRecognizer *)recognizer } @end + +#endif // !TARGET_OS_TV diff --git a/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm b/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm index d8c709fd5061..ea2952c23e78 100644 --- a/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm +++ b/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm @@ -15,6 +15,8 @@ #import "RCTSurfacePointerHandler.h" #import "RCTTouchableComponentViewProtocol.h" +#if !TARGET_OS_TV + using namespace facebook::react; typedef NS_ENUM(NSInteger, RCTTouchEventType) { @@ -414,3 +416,5 @@ - (void)_cancelTouches } @end + +#endif // !TARGET_OS_TV diff --git a/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm b/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm index cf932b52bf00..2a5a3a66346f 100644 --- a/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm +++ b/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm @@ -45,7 +45,9 @@ @implementation RCTFabricSurface { // Can be accessed from the main thread only. RCTSurfaceView *_Nullable _view; +#if !TARGET_OS_TV RCTSurfaceTouchHandler *_Nullable _touchHandler; +#endif } @synthesize delegate = _delegate; @@ -144,8 +146,10 @@ - (RCTSurfaceView *)view if (!_view) { _view = [[RCTSurfaceView alloc] initWithSurface:self]; [self _updateLayoutContext]; +#if !TARGET_OS_TV _touchHandler = [RCTSurfaceTouchHandler new]; [_touchHandler attachToView:_view]; +#endif } return _view; diff --git a/packages/react-native/React/Modules/RCTRedBoxExtraDataViewController.m b/packages/react-native/React/Modules/RCTRedBoxExtraDataViewController.m index 6afd630eac28..c3c089d85989 100644 --- a/packages/react-native/React/Modules/RCTRedBoxExtraDataViewController.m +++ b/packages/react-native/React/Modules/RCTRedBoxExtraDataViewController.m @@ -108,7 +108,9 @@ - (void)viewDidLoad _tableView.delegate = self; _tableView.dataSource = self; _tableView.backgroundColor = [UIColor colorWithRed:0.8 green:0 blue:0 alpha:1]; +#if !TARGET_OS_TV _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; +#endif _tableView.indicatorStyle = UIScrollViewIndicatorStyleWhite; _tableView.allowsSelection = NO; [self.view addSubview:_tableView];