Skip to content

Commit e0b5bbb

Browse files
committed
Fix NSLineBreakMode
1 parent ac964e6 commit e0b5bbb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sources/OpenSwiftUI_SPI/Shims/UIFoundation/NSParagraphStyle.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ NS_HEADER_AUDIT_BEGIN(nullability, sendability)
2828
#if !__NSPARAGRAPH_STYLE_SHARED_SECTION__
2929
#define __NSPARAGRAPH_STYLE_SHARED_SECTION__ 1
3030

31+
#if OPENSWIFTUI_TARGET_OS_OSX
3132
typedef NS_ENUM(NSUInteger, NSLineBreakMode) {
3233
NSLineBreakByWordWrapping = 0, // Wrap at word boundaries, default
3334
NSLineBreakByCharWrapping, // Wrap at character boundaries
@@ -36,6 +37,16 @@ typedef NS_ENUM(NSUInteger, NSLineBreakMode) {
3637
NSLineBreakByTruncatingTail, // Truncate at tail of line: "abcd..."
3738
NSLineBreakByTruncatingMiddle // Truncate middle of line: "ab...yz"
3839
} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0), visionos(1.0));
40+
#else
41+
typedef NS_ENUM(NSInteger, NSLineBreakMode) {
42+
NSLineBreakByWordWrapping = 0, // Wrap at word boundaries, default
43+
NSLineBreakByCharWrapping, // Wrap at character boundaries
44+
NSLineBreakByClipping, // Simply clip
45+
NSLineBreakByTruncatingHead, // Truncate at head of line: "...wxyz"
46+
NSLineBreakByTruncatingTail, // Truncate at tail of line: "abcd..."
47+
NSLineBreakByTruncatingMiddle // Truncate middle of line: "ab...yz"
48+
} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0), visionos(1.0));
49+
#endif
3950

4051
// Line break strategy describes a collection of options that can affect where line breaks are placed in a paragraph.
4152
// This is independent from line break mode, which describes what happens when text is too long to fit within its container.

0 commit comments

Comments
 (0)