Skip to content

Commit 699aa3e

Browse files
sbuggayfacebook-github-bot
authored andcommitted
Log/redbox compiling for AppleTV (facebook#55197)
Summary: Platform guarding some unavailable UIKit APIs. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D90711498
1 parent 63d4570 commit 699aa3e

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

packages/react-native/React/CoreModules/RCTLogBoxView.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ @implementation RCTLogBoxView {
2020
- (instancetype)initWithFrame:(CGRect)frame
2121
{
2222
if ((self = [super initWithFrame:frame]) != nullptr) {
23+
#if !TARGET_OS_TV
2324
self.windowLevel = UIWindowLevelStatusBar - 1;
25+
#endif
2426
self.backgroundColor = [UIColor clearColor];
2527
}
2628
return self;
@@ -40,7 +42,9 @@ - (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge
4042
{
4143
self = [super initWithWindowScene:window.windowScene];
4244

45+
#if !TARGET_OS_TV
4346
self.windowLevel = UIWindowLevelStatusBar - 1;
47+
#endif
4448
self.backgroundColor = [UIColor clearColor];
4549

4650
_surface = [[RCTSurface alloc] initWithBridge:bridge moduleName:@"LogBox" initialProperties:@{}];

packages/react-native/React/CoreModules/RCTRedBox.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ - (void)viewDidLoad
108108
_stackTraceTableView.delegate = self;
109109
_stackTraceTableView.dataSource = self;
110110
_stackTraceTableView.backgroundColor = [UIColor clearColor];
111+
#if !TARGET_OS_TV
111112
_stackTraceTableView.separatorColor = [UIColor colorWithWhite:1 alpha:0.3];
112113
_stackTraceTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
114+
#endif
113115
_stackTraceTableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
114116
[self.view addSubview:_stackTraceTableView];
115117

@@ -308,8 +310,10 @@ - (void)copyStack
308310
[fullStackTrace appendFormat:@" %@\n", [self formatFrameSource:stackFrame]];
309311
}
310312
}
313+
#if !TARGET_OS_TV
311314
UIPasteboard *pb = [UIPasteboard generalPasteboard];
312315
[pb setString:fullStackTrace];
316+
#endif
313317
}
314318

315319
- (NSString *)formatFrameSource:(RCTJSStackFrame *)stackFrame

packages/react-native/React/Modules/RCTRedBoxExtraDataViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ - (void)viewDidLoad
108108
_tableView.delegate = self;
109109
_tableView.dataSource = self;
110110
_tableView.backgroundColor = [UIColor colorWithRed:0.8 green:0 blue:0 alpha:1];
111+
#if !TARGET_OS_TV
111112
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
113+
#endif
112114
_tableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
113115
_tableView.allowsSelection = NO;
114116
[self.view addSubview:_tableView];

0 commit comments

Comments
 (0)