Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Sources/OpenSwiftUI_SPI/Shims/UIFoundation/NSStringDrawing.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ typedef NS_OPTIONS(NSInteger, NSStringDrawingOptions) {
NSStringDrawingUsesFontLeading = 1 << 1, // Uses the font leading for calculating line heights
NSStringDrawingUsesDeviceMetrics = 1 << 3, // Uses image glyph bounds instead of typographic bounds
NSStringDrawingTruncatesLastVisibleLine API_AVAILABLE(macos(10.5), ios(6.0), tvos(9.0), watchos(2.0), visionos(1.0)) = 1 << 5, // Truncates and adds the ellipsis character to the last visible line if the text doesn't fit into the bounds specified. Ignored if NSStringDrawingUsesLineFragmentOrigin is not also set.
// Check if Xcode 26.0 related platform SDKs are available
#if (defined(__IPHONE_26_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_26_0) || \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This #if guard checks iOS/macOS/tvOS/watchOS SDK macros, but the new option is also marked API_AVAILABLE(..., visionos(26.0)). If visionOS SDKs gate availability via vision-specific macros (e.g. __VISION*_VERSION_MAX_ALLOWED), consider including that here so the shim stays in sync when building for visionOS.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

(defined(__MAC_26_0) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_26_0) || \
(defined(__TV_26_0) && __TV_OS_VERSION_MAX_ALLOWED >= __TV_26_0) || \
(defined(__WATCH_26_0) && __WATCH_OS_VERSION_MAX_ALLOWED >= __WATCH_26_0)
/// Specifies the behavior for resolving ``NSTextAlignment.natural`` to the visual alignment.
///
/// When set, the resolved visual alignment is determined by the resolved base writing direction; otherwise, it is using the user’s preferred language.
NSStringDrawingOptionsResolvesNaturalAlignmentWithBaseWritingDirection API_AVAILABLE(macos(26.0), ios(26.0), tvos(26.0), visionos(26.0), watchos(26.0)) = (1 << 9),
#endif
#if OPENSWIFTUI_TARGET_OS_OSX
NSStringDrawingDisableScreenFontSubstitution API_DEPRECATED("", macos(10.0,10.11)) = (1 << 2),
NSStringDrawingOneShot API_DEPRECATED("", macos(10.0,10.11)) = (1 << 4),
Expand Down
Loading