Add tvOS to various @available version directives (#55199)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55199

A few places `available` is missing tvOS, adding to fix the build.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D90712192

fbshipit-source-id: ca4c15c1aa47176290a7b33f4480ecd9b9935b67
This commit is contained in:
Devan Buggay authored and meta-codesync[bot] committed 2026-01-16 13:54:04 -08:00
1 parent 3bc9a5cacb
commit 808882c52b
3 files changed
+14 -10

No files matched your search

@@ -216,7 +216,7 @@ UITextContentType RCTUITextContentTypeFromString(const std::string &contentType)
@"oneTimeCode" : UITextContentTypeOneTimeCode,
}];
if (@available(iOS 15.0, *)) {
if (@available(iOS 15.0, tvOS 15.0, *)) {
[mutableContentTypeMap addEntriesFromDictionary:@{
@"dateTime" : UITextContentTypeDateTime,
@"flightNumber" : UITextContentTypeFlightNumber,
@@ -301,17 +301,21 @@ static PointerEvent CreatePointerEventFromActivePointer(
event.pressure = activePointer.force;
if (activePointer.touchType == UITouchTypeIndirectPointer) {
// pointer events with a mouse button pressed should report a pressure of 0.5
// when the touch is down and 0.0 when it is lifted regardless of how it is reported by the OS
event.pressure = eventType != RCTPointerEventTypeEnd ? 0.5 : 0.0;
if (@available(iOS 13.4, tvOS 13.4, *)) {
if (activePointer.touchType == UITouchTypeIndirectPointer) {
// pointer events with a mouse button pressed should report a pressure of 0.5
// when the touch is down and 0.0 when it is lifted regardless of how it is reported by the OS
event.pressure = eventType != RCTPointerEventTypeEnd ? 0.5 : 0.0;
}
}
CGFloat pointerSize = activePointer.majorRadius * 2.0;
if (activePointer.touchType == UITouchTypeIndirectPointer) {
// mouse type pointers should always report a size of 1
pointerSize = 1.0;
if (@available(iOS 13.4, tvOS 13.4, *)) {
if (activePointer.touchType == UITouchTypeIndirectPointer) {
// mouse type pointers should always report a size of 1
pointerSize = 1.0;
}
}
event.width = pointerSize;
@@ -49,13 +49,13 @@ inline static NSLineBreakStrategy RCTNSLineBreakStrategyFromLineBreakStrategy(
case facebook::react::LineBreakStrategy::PushOut:
return NSLineBreakStrategyPushOut;
case facebook::react::LineBreakStrategy::HangulWordPriority:
if (@available(iOS 14.0, *)) {
if (@available(iOS 14.0, tvOS 14.0, *)) {
return NSLineBreakStrategyHangulWordPriority;
} else {
return NSLineBreakStrategyNone;
}
case facebook::react::LineBreakStrategy::Standard:
if (@available(iOS 14.0, *)) {
if (@available(iOS 14.0, tvOS 14.0, *)) {
return NSLineBreakStrategyStandard;
} else {
return NSLineBreakStrategyNone;