-
Notifications
You must be signed in to change notification settings - Fork 570
UIKit iOS xcode27.0 b2
Alex Soto edited this page Jun 23, 2026
·
1 revision
#UIKit.framework
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h 2026-05-29 23:05:22
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h 2026-06-18 01:46:15
@@ -20,28 +20,56 @@
#if !__NSPARAGRAPH_STYLE_SHARED_SECTION__
#define __NSPARAGRAPH_STYLE_SHARED_SECTION__ 1
+/// Constants that specify what happens when a line is too long for a container.
typedef NS_ENUM(NSInteger, NSLineBreakMode) {
- NSLineBreakByWordWrapping = 0, // Wrap at word boundaries, default
- NSLineBreakByCharWrapping, // Wrap at character boundaries
- NSLineBreakByClipping, // Simply clip
- NSLineBreakByTruncatingHead, // Truncate at head of line: "...wxyz"
- NSLineBreakByTruncatingTail, // Truncate at tail of line: "abcd..."
- NSLineBreakByTruncatingMiddle // Truncate middle of line: "ab...yz"
+ /// Wrapping occurs at word boundaries, unless the word doesn't fit.
+ NSLineBreakByWordWrapping = 0,
+ /// Wrapping occurs before the first character that doesn't fit.
+ NSLineBreakByCharWrapping,
+ /// Lines don't extend past the edge of the text container.
+ NSLineBreakByClipping,
+ /// A line displays so that the end fits in the container and an ellipsis glyph indicates the missing text at the beginning of the line.
+ ///
+ /// Although this mode works for multiline text, it's more often used for
+ /// single line text.
+ NSLineBreakByTruncatingHead,
+ /// A line displays so that the beginning fits in the container and an ellipsis glyph indicates the missing text at the end of the line.
+ ///
+ /// Although this mode works for multiline text, it's more often used for
+ /// single line text.
+ NSLineBreakByTruncatingTail,
+ /// A line displays so that the beginning and end fit in the container and an ellipsis glyph indicates the missing text in the middle.
+ ///
+ /// Use this mode for single-line layout; using it with multiline text
+ /// truncates the text into a single line.
+ NSLineBreakByTruncatingMiddle
} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0), visionos(1.0));
-// Line break strategy describes a collection of options that can affect where line breaks are placed in a paragraph.
-// This is independent from line break mode, which describes what happens when text is too long to fit within its container.
-// These options won't have any effect when used with line break modes that don't support multiple lines, like clipping or truncating middle.
+/// Constants that specify how the text system breaks lines while laying out paragraphs.
+///
+/// Line break strategy describes a collection of options that can affect where
+/// line breaks are placed in a paragraph. This is independent from line break
+/// mode, which describes what happens when text is too long to fit within its
+/// container. These options won't have any effect when used with line break
+/// modes that don't support multiple lines, like clipping or truncating middle.
typedef NS_OPTIONS(NSUInteger, NSLineBreakStrategy) {
- // Don't use any line break strategies
+ /// The text system doesn't use any non-default line-break strategies.
NSLineBreakStrategyNone = 0,
- // Use the push out line break strategy.
- // This strategy allows the text system to "push out" individual lines by some number of words to avoid an orphan word on the last line of the paragraph.
- // The current implementation usually pushes out the last line by a single word.
+ /// The text system pushes out individual lines to avoid an orphan word on the last line of the paragraph.
+ ///
+ /// To avoid an orphan word on the last line of a paragraph before a page
+ /// break, the text system may extend individual lines by one or more words.
+ /// Typically, the text system only pushes out the last line by one word.
NSLineBreakStrategyPushOut API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0)) = 1 << 0,
- // When specified, it prohibits breaking between Hangul characters. It is the preferable typesetting strategy for the modern Korean documents suitable for UI strings.
+ /// The text system prohibits breaking between Hangul syllables.
+ ///
+ /// To avoid breaking between Hangul syllables, this strategy is preferred
+ /// for typesetting modern Korean documents that display UI strings.
NSLineBreakStrategyHangulWordPriority API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0), visionos(1.0)) = 1 << 1,
- // Use the same configuration of line break strategies that the system uses for standard UI labels. This set of line break strategies is optimized for displaying shorter strings that are common in UI labels and may not be suitable for large amounts of text.
+ /// The text system uses the same configuration of line-break strategies that it uses for standard UI labels.
+ ///
+ /// This strategy optimizes for displaying shorter strings that are common
+ /// in UI labels. This strategy may be unsuitable for large amounts of text.
NSLineBreakStrategyStandard API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0), visionos(1.0)) = 0xFFFF
} API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0));
@@ -49,97 +77,464 @@
// NSTextTab
typedef NSString * NSTextTabOptionKey NS_TYPED_ENUM API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
-UIKIT_EXTERN NSTextTabOptionKey const NSTabColumnTerminatorsAttributeName API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0)); // An attribute for NSTextTab options. The value is NSCharacterSet. The character set is used to determine the tab column terminating character. The tab and newline characters are implied even if not included in the character set.
+/// The characters that terminate a tab column.
+///
+/// The value is an `NSCharacterSet` object. The tab and newline characters are
+/// implied even if they don't exist in the character set. This attribute is
+/// optional.
+UIKIT_EXTERN NSTextTabOptionKey const NSTabColumnTerminatorsAttributeName API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+
+/// A tab in a paragraph.
+///
+/// A text tab represents a tab in an ``NSParagraphStyle`` object, storing an
+/// alignment type and location. ``NSTextTab`` objects are most frequently used
+/// with the TextKit system and with
+/// <doc://com.apple.documentation/documentation/UIKitCore/nsrulerview> and
+/// <doc://com.apple.documentation/documentation/UIKitCore/nsrulermarker> objects.
+///
+/// The text system supports four alignment types: left, center, right, and
+/// decimal (based on the decimal separator character of the locale in effect).
+/// These alignment types are absolute, not based on the line sweep direction of
+/// text. For example, tabbed text is always positioned to the left of a
+/// right-aligned tab, whether the line sweep direction is left to right or
+/// right to left. A tab's location, on the other hand, is relative to the back
+/// margin. A tab set at 1.5", for example, is at 1.5" from the right in right
+/// to left text.
UIKIT_EXTERN API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0))
@interface NSTextTab : NSObject <NSCopying, NSCoding, NSSecureCoding>
-+ (NSCharacterSet *)columnTerminatorsForLocale:(nullable NSLocale *)aLocale API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0)); // Returns the column terminators for locale. Passing nil returns an instance corresponding to +[NSLocale systemLocale]. For matching user's formatting preferences, pass +[NSLocale currentLocale]. Can be used as the value for NSTabColumnTerminatorsAttributeName to make a decimal tab stop.
+/// Returns the column terminators for the specified locale.
+///
+/// The returned value can be used as the value for
+/// ``NSTextTab/OptionKey/columnTerminators`` to make a decimal tab stop.
+///
+/// - Parameters:
+/// - aLocale: The locale to use when determining the terminators. Specify `nil` to use the system's current locale. You can get the user's locale using the <doc://com.apple.documentation/documentation/foundation/nslocale/1409990-current> method of <doc://com.apple.documentation/documentation/foundation/nslocale>.
+///
+/// - Returns: The characters for the column terminators.
++ (NSCharacterSet *)columnTerminatorsForLocale:(nullable NSLocale *)aLocale API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
-- (instancetype)initWithTextAlignment:(NSTextAlignment)alignment location:(CGFloat)loc options:(NSDictionary<NSTextTabOptionKey, id> *)options NS_DESIGNATED_INITIALIZER; // Initializes a text tab with the text alignment, location, and options. The text alignment is used to determine the position of text inside the tab column.
+/// Initializes a text tab with the text alignment, location, and options.
+///
+/// The text alignment is used to determine the position of text inside the tab column.
+///
+/// - Parameters:
+/// - alignment: The text alignment for the tab column.
+/// - loc: The location of the tab stop.
+/// - options: Optional configuration attributes.
+- (instancetype)initWithTextAlignment:(NSTextAlignment)alignment location:(CGFloat)loc options:(NSDictionary<NSTextTabOptionKey, id> *)options NS_DESIGNATED_INITIALIZER;
-@property (readonly, NS_NONATOMIC_IOSONLY) NSTextAlignment alignment; // Defines the alignment of tab column contents. NSTextAlignmentNatural and NSTextAlignmentJustified are resolved either NSTextAlignmentLeft or NSTextAlignmentRight based on the user's preferred language.
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat location; // Location of the tab stop inside the line fragment rect coordinate system
-@property (readonly, NS_NONATOMIC_IOSONLY) NSDictionary<NSTextTabOptionKey, id> *options; // Optional configuration attributes
+/// The text alignment of the text tab.
+///
+/// `NSTextAlignmentNatural` and `NSTextAlignmentJustified` are resolved to
+/// either `NSTextAlignmentLeft` or `NSTextAlignmentRight` based on the user's
+/// preferred language.
+@property (readonly, NS_NONATOMIC_IOSONLY) NSTextAlignment alignment;
+
+/// The text tab's ruler location relative to the back margin.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat location;
+
+/// The dictionary of attributes for the text tab.
+@property (readonly, NS_NONATOMIC_IOSONLY) NSDictionary<NSTextTabOptionKey, id> *options;
@end
-// NSParagraphStyle
+/// The paragraph or ruler attributes for an attributed string.
+///
+/// An ``NSParagraphStyle`` object stores formatting information for a paragraph
+/// of text. The formatting information includes the amount of space between
+/// lines, indentations for lines of text, line heights, tab-stop positions, and
+/// more. Apply paragraph styles to the text of an attributed string by adding
+/// the
+/// <doc://com.apple.documentation/documentation/foundation/nsattributedstring/key/1527910-paragraphstyle>
+/// attribute in Swift or the ``NSParagraphStyleAttributeName`` attribute in
+/// Objective-C and setting its value to an instance of this class. The
+/// text-rendering system uses the paragraph style information in an attributed
+/// string to lay out and render the text.
+///
+/// The ``NSParagraphStyle`` class manages an immutable set of style
+/// information, but you can create an ``NSMutableParagraphStyle`` when you want
+/// to modify the style information before applying it to your text.
UIKIT_EXTERN API_AVAILABLE(macos(10.0), ios(6.0), tvos(9.0), watchos(2.0), visionos(1.0))
@interface NSParagraphStyle : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
+/// The text alignment of the paragraph.
@property (readonly, NS_NONATOMIC_IOSONLY) NSTextAlignment alignment;
-@property (class, readonly, copy, NS_NONATOMIC_IOSONLY) NSParagraphStyle *defaultParagraphStyle; // This class property returns a shared and cached NSParagraphStyle instance with the default style settings, with same value as the result of [[NSParagraphStyle alloc] init].
+/// The default paragraph style.
+///
+/// The default paragraph style has the following default values:
+///
+/// | Subattribute | Default |
+/// |---|---|
+/// | Alignment | `NSNaturalTextAlignment` |
+/// | Tab stops | 12 left-aligned tabs, spaced by `28.0` points |
+/// | Line break mode | `NSLineBreakByWordWrapping` |
+/// | All others | `0.0` |
+///
+/// See individual method descriptions for explanations of each subattribute.
+@property (class, readonly, copy, NS_NONATOMIC_IOSONLY) NSParagraphStyle *defaultParagraphStyle;
-+ (NSWritingDirection)defaultWritingDirectionForLanguage:(nullable NSString *)languageName; // languageName is in ISO lang region format
+/// Returns the default writing direction for the specified language.
+///
+/// - Parameters:
+/// - languageName: The language specified in ISO language region format. Can be `nil` to return a default writing direction derived from the user's defaults database.
+///
+/// - Returns: The default writing direction.
++ (NSWritingDirection)defaultWritingDirectionForLanguage:(nullable NSString *)languageName;
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat lineSpacing; // "Leading": distance between the bottom of one line fragment and top of next (applied between lines in the same container). This value is included in the line fragment heights in layout manager.
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat paragraphSpacing; // Distance between the bottom of this paragraph and top of next (or the beginning of its paragraphSpacingBefore, if any).
+/// The distance in points between the bottom of one line fragment and the top of the next.
+///
+/// This value is always nonnegative. The text layout manager uses this value in the
+/// line fragment height.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat lineSpacing;
+/// Distance between the bottom of this paragraph and top of next.
+///
+/// This property contains the space (measured in points) between paragraphs.
+/// This value is always nonnegative. The framework determines the space between
+/// paragraphs by adding the previous paragraph's `paragraphSpacing` and the
+/// current paragraph's ``NSParagraphStyle/paragraphSpacingBefore``.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat paragraphSpacing;
+
// The following values are relative to the appropriate margin (depending on the paragraph direction)
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat headIndent; // Distance from margin to front edge of paragraph
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat tailIndent; // Distance from margin to back edge of paragraph; if negative or 0, from other margin
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat firstLineHeadIndent; // Distance from margin to edge appropriate for text direction
+/// The indentation of the paragraph's lines other than the first.
+///
+/// This property contains the distance (in points) from the leading margin of a
+/// text container to the beginning of lines other than the first. This value is
+/// always nonnegative.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat headIndent;
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat minimumLineHeight; // Line height is the distance from bottom of descenders to top of ascenders; basically the line fragment height. Does not include lineSpacing (which is added after this computation).
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat maximumLineHeight; // 0 implies no maximum.
+/// The trailing indentation of the paragraph.
+///
+/// If positive, this value is the distance from the leading margin (for
+/// example, the left margin in left-to-right text). If `0` or negative, it's
+/// the distance from the trailing margin.
+///
+/// For example, a paragraph style designed to fit exactly in a two-inch wide
+/// container has a head indent of `0.0` and a tail indent of `0.0`. One
+/// designed to fit with a quarter-inch margin has a head indent of `0.25` and a
+/// tail indent of `–0.25`.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat tailIndent;
+/// The indentation of the first line of the paragraph.
+///
+/// This property contains the distance (in points) from the leading margin of a
+/// text container to the beginning of the paragraph's first line. This value is
+/// always nonnegative.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat firstLineHeadIndent;
+
+/// The paragraph's minimum line height.
+///
+/// This property contains the minimum height in points that any line in the
+/// receiver occupies, regardless of the font size or size of any attached
+/// graphic. This value is always nonnegative.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat minimumLineHeight;
+
+/// The paragraph's maximum line height.
+///
+/// This property contains the maximum height in points that any line in the
+/// receiver occupies, regardless of the font size or size of any attached
+/// graphic. This value is always nonnegative. The default value is `0`.
+///
+/// Glyphs and graphics exceeding this height overlap neighboring lines;
+/// however, a maximum height of `0` implies no line height limit. Although this
+/// limit applies to the line itself, line spacing adds extra space between
+/// adjacent lines.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat maximumLineHeight;
+
+/// The mode for breaking lines in the paragraph that don't fit within a container.
+///
+/// This property controls how the text system lays out lines that don't fit in
+/// its container, such as by truncating with an ellipsis (…) or clipping the
+/// text. This is different from ``NSParagraphStyle/LineBreakStrategy``, which
+/// controls where the system places line breaks in a paragraph.
@property (readonly, NS_NONATOMIC_IOSONLY) NSLineBreakMode lineBreakMode;
+/// The base writing direction for the paragraph.
+///
+/// If the value of this property is ``NSWritingDirection/natural``, the
+/// consumer of the value must resolve the writing direction based on the
+/// paragraph contents using the Unicode Bidi Algorithm.
@property (readonly, NS_NONATOMIC_IOSONLY) NSWritingDirection baseWritingDirection;
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat lineHeightMultiple; // Natural line height is multiplied by this factor (if positive) before being constrained by minimum and maximum line height.
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat paragraphSpacingBefore; // Distance between the bottom of the previous paragraph (or the end of its paragraphSpacing, if any) and the top of this paragraph.
+/// The line height multiple.
+///
+/// The framework multiplies the natural line height of the receiver by this
+/// factor (if positive), and constrains the resulting value by the minimum and
+/// maximum line height. The default value of this property is `0.0`.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat lineHeightMultiple;
-// Specifies the threshold for hyphenation. Valid values lie between 0.0 and 1.0 inclusive. Hyphenation will be attempted when the ratio of the text width as broken without hyphenation to the width of the line fragment is less than the hyphenation factor. When this takes on its default value of 0.0, the layout manager's hyphenation factor is used instead. When both are 0.0, hyphenation is disabled.
+/// The distance between the paragraph's top and the beginning of its text content.
+///
+/// This property contains the space (measured in points) between the current
+/// and previous paragraphs. The default value of this property is `0.0`.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat paragraphSpacingBefore;
+
+/// The paragraph's threshold for hyphenation.
+///
+/// The system attempts hyphenation when the ratio of the text width (as broken
+/// without hyphenation) to the width of the line fragment is less than the
+/// hyphenation factor. When the paragraph's hyphenation factor is `0.0`, the
+/// system uses the text layout manager's hyphenation factor instead. The system
+/// disables hyphenation when both are `0.0`. This property detects the
+/// user-selected language by examining the first item in
+/// <doc://com.apple.documentation/documentation/foundation/nslocale/1415614-preferredlanguages>.
+///
+/// ## See Also
+///
+/// - <doc://com.apple.documentation/documentation/coretext/kCTLanguageAttributeName>
@property (readonly, NS_NONATOMIC_IOSONLY) float hyphenationFactor;
-// A property controlling the hyphenation behavior for the paragraph associated with the paragraph style. The exact hyphenation logic is dynamically determined by the layout context such as language, platform, etc. When YES, it affects the return value from -hyphenationFactor when the property is set to 0.0.
+/// A Boolean value that indicates whether the paragraph style uses the system hyphenation settings.
+///
+/// The system determines the exact hyphenation logic dynamically by examining
+/// the layout context such as language, platform, etc. When `true`, it affects
+/// the return value from ``hyphenationFactor`` when the property is set to
+/// `0.0`.
@property (readonly, NS_NONATOMIC_IOSONLY) BOOL usesDefaultHyphenation API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0), visionos(1.0));
-@property (readonly,copy, NS_NONATOMIC_IOSONLY) NSArray<NSTextTab *> *tabStops API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0)); // An array of NSTextTabs. Contents should be ordered by location. The default value is an array of 12 left-aligned tabs at 28pt interval
-@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat defaultTabInterval API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0)); // The default tab interval used for locations beyond the last element in tabStops
+/// The text tab objects that represent the paragraph's tab stops.
+///
+/// The ``NSTextTab`` objects, sorted by location, define the tab stops for the
+/// paragraph style. The default value is an array of 12 left-aligned tabs at
+/// 28-point intervals.
+@property (readonly,copy, NS_NONATOMIC_IOSONLY) NSArray<NSTextTab *> *tabStops API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
-@property (readonly, copy, NS_NONATOMIC_IOSONLY) NSArray<NSTextList *> *textLists API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0)); // Array to specify the text lists containing the paragraph, nested from outermost to innermost.
+/// The documentwide default tab interval.
+///
+/// This property represents the default tab interval in points. Tabs after the
+/// last specified in ``NSParagraphStyle/tabStops`` are placed at integer
+/// multiples of this distance (if positive). Default value is `0.0`.
+@property (readonly, NS_NONATOMIC_IOSONLY) CGFloat defaultTabInterval API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
-@property (readonly, copy, NS_NONATOMIC_IOSONLY) NSArray<__kindof NSTextBlock *> *textBlocks API_AVAILABLE(macos(10.0), ios(6.0), tvos(9.0), visionos(1.0), watchos(2.0)); // Array to specify the text blocks containing the paragraph, nested from outermost to innermost.
+/// The text lists that contain the paragraph, nested from outermost to innermost.
+@property (readonly, copy, NS_NONATOMIC_IOSONLY) NSArray<NSTextList *> *textLists API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
-@property (readonly, NS_NONATOMIC_IOSONLY) BOOL allowsDefaultTighteningForTruncation API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0)); // Tightens inter-character spacing in attempt to fit lines wider than the available space if the line break mode is one of the truncation modes before starting to truncate. NO by default. The maximum amount of tightening performed is determined by the system based on contexts such as font, line width, etc.
+/// The text blocks that contain the paragraph, nested from outermost to innermost.
+@property (readonly, copy, NS_NONATOMIC_IOSONLY) NSArray<__kindof NSTextBlock *> *textBlocks API_AVAILABLE(macos(10.0), ios(6.0), tvos(9.0), visionos(1.0), watchos(2.0));
-@property (readonly, NS_NONATOMIC_IOSONLY) NSLineBreakStrategy lineBreakStrategy API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0)); // Specifies the line break strategies that may be used for laying out the paragraph. The default value is NSLineBreakStrategyNone.
+/// A Boolean value that indicates whether the system tightens character spacing before truncating text.
+///
+/// When this property is
+/// <doc://com.apple.documentation/documentation/swift/true>, the system tries
+/// to reduce the space between characters before truncating characters. The
+/// system performs this tightening in cases where the text wouldn't otherwise
+/// fit in the available space. The maximum amount of tightening performed by
+/// the system is dependent on the font, line width, and other factors.
+///
+/// The default value of this property is
+/// <doc://com.apple.documentation/documentation/swift/false>.
+@property (readonly, NS_NONATOMIC_IOSONLY) BOOL allowsDefaultTighteningForTruncation API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The strategy for breaking lines while laying out paragraphs.
+///
+/// Line-break strategies are collections of options the system uses to
+/// determine where to break lines in a paragraph. This is different from
+/// ``NSParagraphStyle/lineBreakMode``, which controls how to lay out lines of
+/// text that don't fit in a container. The system ignores this property if the
+/// paragraph style's ``NSParagraphStyle/lineBreakMode`` property specifies a
+/// mode that doesn't support multiple lines, such as
+/// ``NSLineBreakMode/byClipping``.
+///
+/// The default value is ``NSLineBreakStrategy/NSLineBreakStrategyNone``.
+@property (readonly, NS_NONATOMIC_IOSONLY) NSLineBreakStrategy lineBreakStrategy API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0));
+
@end
+/// An object for changing the values of the subattributes in a paragraph style attribute.
+///
+/// The ``NSMutableParagraphStyle`` class adds methods to its superclass,
+/// ``NSParagraphStyle``, for changing the values of the subattributes in a
+/// paragraph style attribute. For more information, see ``NSParagraphStyle``
+/// and
+/// <doc://com.apple.documentation/documentation/foundation/nsattributedstring>.
+///
+/// > Important:
+/// > Don't mutate a paragraph style object after adding it to an attributed
+/// string. Doing so can cause your app to crash.
UIKIT_EXTERN API_AVAILABLE(macos(10.0), ios(6.0), tvos(9.0), watchos(2.0), visionos(1.0))
@interface NSMutableParagraphStyle : NSParagraphStyle
+/// The text alignment of the paragraph.
@property (NS_NONATOMIC_IOSONLY) NSTextAlignment alignment;
+
+/// The distance in points between the bottom of one line fragment and the top of the next.
+///
+/// This value is always nonnegative. This value is included in the line
+/// fragment heights in the text layout manager.
@property (NS_NONATOMIC_IOSONLY) CGFloat lineSpacing;
+
+/// The space after the end of the paragraph.
+///
+/// This property contains the space (measured in points) added at the end of
+/// the paragraph to separate it from the following paragraph. This value must
+/// be nonnegative. The space between paragraphs is determined by adding the
+/// previous paragraph's `paragraphSpacing` and the current paragraph's
+/// ``NSMutableParagraphStyle/paragraphSpacingBefore``.
@property (NS_NONATOMIC_IOSONLY) CGFloat paragraphSpacing;
+
+/// The indentation of the first line of the paragraph.
+///
+/// This property contains the distance (in points) from the leading margin of a
+/// text container to the beginning of the paragraph's first line. This value is
+/// always nonnegative.
@property (NS_NONATOMIC_IOSONLY) CGFloat firstLineHeadIndent;
+
+/// The indentation of the paragraph's lines other than the first.
+///
+/// This property contains the distance (in points) from the leading margin of a
+/// text container to the beginning of lines other than the first. This value is
+/// always nonnegative.
@property (NS_NONATOMIC_IOSONLY) CGFloat headIndent;
+
+/// The trailing indentation of the paragraph.
+///
+/// If positive, this value is the distance from the leading margin (for
+/// example, the left margin in left-to-right text). If `0` or negative, it's
+/// the distance from the trailing margin.
+///
+/// For example, a paragraph style designed to fit exactly in a 2-inch wide
+/// container has a head indent of `0.0` and a tail indent of `0.0`. One
+/// designed to fit with a quarter-inch margin has a head indent of `0.25` and
+/// a tail indent of `–0.25`.
@property (NS_NONATOMIC_IOSONLY) CGFloat tailIndent;
+
+/// The mode for breaking lines in the paragraph.
+///
+/// This property controls how the text system lays out lines that don't fit in
+/// its container, such as by truncating with an ellipsis (…) or clipping the
+/// text. This is different from ``NSParagraphStyle/LineBreakStrategy``, which
+/// controls where the system places line breaks in a paragraph.
@property (NS_NONATOMIC_IOSONLY) NSLineBreakMode lineBreakMode;
+
+/// The paragraph's minimum line height.
+///
+/// This property contains the minimum height in points that any line in the
+/// receiver will occupy, regardless of the font size or size of any attached
+/// graphic. This value must be nonnegative.
@property (NS_NONATOMIC_IOSONLY) CGFloat minimumLineHeight;
+
+/// The paragraph's maximum line height.
+///
+/// This property contains the maximum height in points that any line in the
+/// receiver will occupy, regardless of the font size or size of any attached
+/// graphic. This value is always nonnegative. The default value is `0`.
+///
+/// Glyphs and graphics exceeding this height will overlap neighboring lines;
+/// however, a maximum height of `0` implies no line height limit. Although this
+/// limit applies to the line itself, line spacing adds extra space between
+/// adjacent lines.
@property (NS_NONATOMIC_IOSONLY) CGFloat maximumLineHeight;
+
+/// The base writing direction for the paragraph.
+///
+/// If you specify ``NSWritingDirection/natural``, the consumer of the value
+/// must resolve the writing direction based on the paragraph contents using
+/// the Unicode Bidi Algorithm.
@property (NS_NONATOMIC_IOSONLY) NSWritingDirection baseWritingDirection;
+
+/// The line height multiple.
+///
+/// The natural line height of the receiver is multiplied by this factor (if
+/// positive) before being constrained by minimum and maximum line height. The
+/// default value of this property is `0.0`.
@property (NS_NONATOMIC_IOSONLY) CGFloat lineHeightMultiple;
+
+/// The distance between the paragraph's top and the beginning of its text content.
+///
+/// This property contains the space (measured in points) between the
+/// paragraph's top and the beginning of its text content. The default value of
+/// this property is `0.0`.
@property (NS_NONATOMIC_IOSONLY) CGFloat paragraphSpacingBefore;
+
+/// The paragraph's threshold for hyphenation.
+///
+/// Valid values lie between `0.0` and `1.0` inclusive. The default value is
+/// `0.0`. Hyphenation is attempted when the ratio of the text width (as broken
+/// without hyphenation) to the width of the line fragment is less than the
+/// hyphenation factor. When the paragraph's hyphenation factor is `0.0`, the
+/// text layout manager's hyphenation factor is used instead. When both are `0.0`,
+/// hyphenation is disabled. This property detects the user-selected language by
+/// examining the first item in `preferredLanguages`.
+///
+/// ## See Also
+///
+/// - <doc://com.apple.documentation/documentation/coretext/kCTLanguageAttributeName>
@property (NS_NONATOMIC_IOSONLY) float hyphenationFactor;
+
+/// A Boolean value that indicates whether the paragraph style uses the system hyphenation settings.
+///
+/// The system determines the exact hyphenation logic dynamically by examining
+/// the layout context such as language, platform, etc. When `true`, it affects
+/// the return value from ``hyphenationFactor`` when the property is set to
+/// `0.0`.
@property (readwrite, NS_NONATOMIC_IOSONLY) BOOL usesDefaultHyphenation API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0), visionos(1.0));
+
+/// The text tab objects that represent the paragraph's tab stops.
+///
+/// The ``NSTextTab`` objects, sorted by location, define the tab stops for the
+/// paragraph style. The default value is an array of 12 left-aligned tabs at
+/// 28-point intervals.
@property (null_resettable, copy, NS_NONATOMIC_IOSONLY) NSArray<NSTextTab *> *tabStops API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+
+/// A number used as the document's default tab spacing.
+///
+/// This property represents the default tab interval in points. The system
+/// places tabs after the last specified in ``tabStops`` at integer multiples of
+/// this distance (if positive). Default value is `0.0`.
@property (NS_NONATOMIC_IOSONLY) CGFloat defaultTabInterval API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+
+/// A Boolean value that indicates whether the system tightens intercharacter spacing before truncating text.
+///
+/// When this property is set to
+/// <doc://com.apple.documentation/documentation/swift/true>, the system tries
+/// to reduce the space between characters before truncating characters. The
+/// system performs this tightening in cases where the text would not otherwise
+/// fit in the available space. The maximum amount of tightening performed by
+/// the system is dependent on the font, line width, and other factors.
+///
+/// The default value of this property is
+/// <doc://com.apple.documentation/documentation/swift/false>.
@property (NS_NONATOMIC_IOSONLY) BOOL allowsDefaultTighteningForTruncation API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0));
+
+/// The strategies that the text system may use to break lines while laying out the paragraph.
+///
+/// Line-break strategies are collections of options the system uses to
+/// determine where to break lines in a paragraph. This is different from
+/// ``NSParagraphStyle/lineBreakMode``, which controls how to lay out lines of
+/// text that don't fit in a container. The system ignores this property if the
+/// paragraph style's ``NSParagraphStyle/lineBreakMode`` property specifies a
+/// mode that doesn't support multiple lines, such as
+/// ``NSLineBreakMode/byClipping``.
+///
+/// The default value is ``NSLineBreakStrategy/NSLineBreakStrategyNone``.
@property (NS_NONATOMIC_IOSONLY) NSLineBreakStrategy lineBreakStrategy API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0));
+
+/// The text lists that contain the paragraph.
@property (NS_NONATOMIC_IOSONLY, copy) NSArray<NSTextList *> *textLists API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+
+/// The text blocks that contain the paragraph.
@property (copy, NS_NONATOMIC_IOSONLY) NSArray<__kindof NSTextBlock *> *textBlocks API_AVAILABLE(macos(10.0), ios(6.0), tvos(9.0), visionos(1.0), watchos(2.0));
+/// Adds the specified tab stop to the paragraph.
+///
+/// ## See Also
+///
+/// - ``tabStops``
- (void)addTabStop:(NSTextTab *)anObject API_AVAILABLE(macos(10.0), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0));
+
+/// Removes the first text tab with a location and type equal to the specified tab stop.
+///
+/// ## See Also
+///
+/// - ``tabStops``
- (void)removeTabStop:(NSTextTab *)anObject API_AVAILABLE(macos(10.0), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// Replaces the subattributes of the paragraph with those in the specified paragraph style object.
- (void)setParagraphStyle:(NSParagraphStyle *)obj API_AVAILABLE(macos(10.0), ios(9.0), tvos(9.0), watchos(2.0), visionos(1.0));
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSText.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSText.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSText.h 2026-05-30 22:15:06
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSText.h 2026-06-18 01:49:53
@@ -46,8 +46,8 @@
#endif // !__NSTEXT_ALIGNMENT_SHARED_SECTION__
UIKIT_SWIFT_FORWARD_DECLARE(typedef CF_ENUM(uint8_t, CTTextAlignment))
-UIKIT_EXTERN CTTextAlignment NSTextAlignmentToCTTextAlignment(NSTextAlignment nsTextAlignment) API_AVAILABLE(macos(10.9), ios(6.0), tvos(9.0), watchos(2.0), visionos(1.0));
-UIKIT_EXTERN NSTextAlignment NSTextAlignmentFromCTTextAlignment(CTTextAlignment ctTextAlignment) API_AVAILABLE(macos(10.9), ios(6.0), tvos(9.0), watchos(2.0), visionos(1.0));
+UIKIT_EXTERN CTTextAlignment NSTextAlignmentToCTTextAlignment(NSTextAlignment nsTextAlignment) API_AVAILABLE(ios(6.0), tvos(9.0), watchos(2.0), visionos(1.0)) API_UNAVAILABLE(macos);
+UIKIT_EXTERN NSTextAlignment NSTextAlignmentFromCTTextAlignment(CTTextAlignment ctTextAlignment) API_AVAILABLE(ios(6.0), tvos(9.0), watchos(2.0), visionos(1.0)) API_UNAVAILABLE(macos);
NS_HEADER_AUDIT_END(nullability, sendability)
#else
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextAttachment.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextAttachment.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextAttachment.h 2026-05-29 22:59:17
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextAttachment.h 2026-06-18 00:07:25
@@ -13,7 +13,8 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
enum {
- NSAttachmentCharacter API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0)) = 0xFFFC // Replacement character is used for attachments
+ /// Specifies a character that denotes an attachment.
+ NSAttachmentCharacter API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0)) = 0xFFFC
} API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
@class NSTextContainer;
@@ -25,97 +26,289 @@
@class NSTextLayoutManager;
@protocol NSTextLocation;
-// This protocol defines the interface to attachment objects from NSTextLayoutManager
+/// A set of methods that defines the interface to attachment objects from a text layout manager.
+///
+/// The `NSTextAttachmentLayout` protocol is the interface for working with
+/// attachment objects with an ``NSTextAttachmentViewProvider`` using a
+/// ``NSTextLayoutManager`` in macOS 12 and iOS 15 and later.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0), visionos(1.0))
@protocol NSTextAttachmentLayout <NSObject>
-// Returns the image object rendered at bounds inside textContainer. It should return an image appropriate for the target rendering context derived by arguments to this method. The NSTextAttachment implementation returns -image when non-nil. If -image==nil, it returns an image based on -contents and -fileType properties.
+/// Returns the image object rendered at the bounds and inside the text container you specify.
+///
+/// A custom implementation should return an image appropriate for the target
+/// rendering context that you derive by arguments to this method. The default
+/// ``NSTextAttachment`` implementation returns the contents of the `image`
+/// property when non-`nil`. If the `image` property is `nil`, it returns an
+/// image based on the `contents` and `fileType` properties.
+///
+/// - Parameters:
+/// - bounds: The <doc://com.apple.documentation/documentation/corefoundation/cgrect> that presents the image boundaries inside `textContainer`.
+/// - attributes: A dictionary of <doc://com.apple.documentation/documentation/foundation/nsattributedstring/key> attributes.
+/// - location: An ``NSTextLocation`` that indicates the location of the attachment inside the document.
+/// - textContainer: The ``NSTextContainer`` that defines the area to fill in with text.
+///
+/// - Returns: An optional image object.
- (nullable UIImage *)imageForBounds:(CGRect)bounds attributes:(NSDictionary<NSAttributedStringKey, id> *)attributes location:(id <NSTextLocation>)location textContainer:(nullable NSTextContainer *)textContainer API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0), visionos(1.0));
-// Returns the layout bounds. The bounds origin is interpreted to match position inside proposedLineFragment. The NSTextAttachment implementation returns -bounds if not CGRectZero; otherwise, it derives the bounds value from image.size. Conforming objects can implement more sophisticated logic for negotiating the frame size based on the available container space and proposed line fragment rect.
+/// Returns the layout bounds of the attachment you specify.
+///
+/// The framework interprets the bounds origin to match `position` inside
+/// `proposedLineFragment`. The default ``NSTextAttachment`` implementation
+/// returns bounds if the value isn't equivalent to
+/// <doc://com.apple.documentation/documentation/coregraphics/cgrectzero>;
+/// otherwise, it derives the bounds value from `image.size`. Conforming objects
+/// can implement more sophisticated logic for negotiating the frame size based
+/// on the available container space and proposed line fragment rectangle.
+///
+/// - Parameters:
+/// - attributes: A dictionary of <doc://com.apple.documentation/documentation/foundation/nsattributedstring/key> attributes.
+/// - location: An ``NSTextLocation`` that indicates the location of the attachment inside the document.
+/// - textContainer: The ``NSTextContainer`` that defines the area to fill in with text.
+/// - proposedLineFragment: A <doc://com.apple.documentation/documentation/corefoundation/cgrect> that describes the boundaries of the line fragment.
+/// - position: A <doc://com.apple.documentation/documentation/corefoundation/cgpoint> inside `proposedLineFragment`.
+///
+/// - Returns: A <doc://com.apple.documentation/documentation/corefoundation/cgrect> that describes the boundaries of the attachment, or `CGRectZero`.
- (CGRect)attachmentBoundsForAttributes:(NSDictionary<NSAttributedStringKey, id> *)attributes location:(id <NSTextLocation>)location textContainer:(nullable NSTextContainer *)textContainer proposedLineFragment:(CGRect)proposedLineFragment position:(CGPoint)position API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0), visionos(1.0));
-// Returns the text attachment view provider corresponding to -fileType. The default implementation queries the text attachment view provider class via +[NSTextAttachment textAttachmentViewProviderClassForFileType:]. When non-nil, it instantiates a view, then, fills properties declared in NSTextAttachmentViewProvider if implemented
+/// Returns the text attachment view provider corresponding to the file type.
+///
+/// The default implementation queries the text attachment view provider class
+/// using the ``NSTextAttachment/textAttachmentViewProviderClass(forFileType:)``
+/// method of ``NSTextAttachment``. When non-`nil`, it instantiates a view, then
+/// fills properties declared in `NSTextAttachmentViewProvider` if implemented.
+///
+/// - Parameters:
+/// - parentView: The parent view.
+/// - location: An ``NSTextLocation`` that indicates the location of the attachment inside the document.
+/// - textContainer: The ``NSTextContainer`` that defines the area to fill in with text.
+///
+/// - Returns: An ``NSTextAttachmentViewProvider``.
- (nullable NSTextAttachmentViewProvider *)viewProviderForParentView:(nullable UIView *)parentView location:(id <NSTextLocation>)location textContainer:(nullable NSTextContainer *)textContainer API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
@end
+/// The values for the attachment characteristics of attributed strings and related objects.
+///
+/// The
+/// <doc://com.apple.documentation/documentation/foundation/nsattributedstring>
+/// class uses text attachment objects as the values for attachment attributes
+/// (stored in the attributed string under the
+/// <doc://com.apple.documentation/documentation/foundation/nsattributedstring/key/1534036-attachment>
+/// key in Swift or the ``NSAttachmentAttributeName`` key in Objective-C).
+///
+/// A text attachment object contains either an
+/// <doc://com.apple.documentation/documentation/foundation/nsdata> object or an
+/// <doc://com.apple.documentation/documentation/foundation/filewrapper> object,
+/// which in turn holds the contents of the attached file. The properties of
+/// this class configure the appearance of the text attachment in your
+/// interface. In macOS, the text attachment also uses a cell object that
+/// conforms to the
+/// <doc://com.apple.documentation/documentation/appkit/nstextattachmentcellprotocol>
+/// protocol to draw the image that represents the text and handles mouse
+/// events. For more information about text attachments, see the
+/// <doc://com.apple.documentation/documentation/foundation/nsattributedstring>
+/// and <doc://com.apple.documentation/documentation/appkit/nstextview>.
+///
+/// In macOS 12 and iOS 15 and later, ``NSTextAttachmentViewProvider`` and
+/// ``NSTextAttachmentLayout`` provide additional capabilities to represent
+/// document locations in terms of an ``NSTextLocation`` or an ``NSTextRange``,
+/// and provide support for view-based text attachments.
API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0)) @interface NSTextAttachment : NSObject <NSTextAttachmentLayout, NSSecureCoding>
/**************************** Initialization ****************************/
-// Designated initializer. Both arguments can be nil. When contentData==nil || uti==nil, the receiver is consider to be an attachment without document contents. In this case, the NSAttributedString methods writing external file format tries to save the return value of -[NSTextAttachment image] instead.
+/// Creates a text attachment object with the specified data.
+///
+/// This method is the designated initializer for the `NSTextAttachment` class.
+///
+/// When either `contentData` or `uti` is `nil`, TextKit considers the receiver
+/// to be an attachment without document contents. In this case, the
+/// `NSAttributedString` external file writing methods try to save the value of
+/// the ``NSTextAttachment/image`` property instead.
+///
+/// - Parameters:
+/// - contentData: Data to use for the text attachment contents. Can be `nil`.
+/// - uti: A uniform type identifier specifying the data type of the attachment contents. Can be `nil`.
+///
+/// - Returns: A new `NSTextAttachment` object.
- (instancetype)initWithData:(nullable NSData *)contentData ofType:(nullable NSString *)uti NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
/**************************** Content properties ****************************/
-// These two properties define the contents for the text attachment. Modifying these properties have a side effect of invalidating -image and -fileWrapper properties. -fileType is an UTI describing the format for -contents.
+/// The contents for the text attachment.
+///
+/// Modifying this property has a side effect of invalidating ``image`` and
+/// ``fileWrapper`` properties.
@property (nullable, copy, NS_NONATOMIC_IOSONLY) NSData *contents API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+
+/// The file type of the contents for the text attachment.
+///
+/// A UTI describing the format for ``contents``. Modifying this property has a
+/// side effect of invalidating ``image`` and ``fileWrapper`` properties.
@property (nullable, copy, NS_NONATOMIC_IOSONLY) NSString *fileType API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
/**************************** Rendering/layout properties ****************************/
-// Image representing the text attachment contents. Modifying this property invalidates -contents, -fileType, and -FileWrapper properties.
+/// An instance of the relevant image class that represents the contents of the text attachment object.
+///
+/// For details about using the
+/// <doc://com.apple.documentation/documentation/uikit/uiimage> class to create
+/// text attachments that automatically adjust to surrounding font and color
+/// attributes, see the
+/// <doc://com.apple.documentation/documentation/uikit/NSTextAttachment/init(image:)>
+/// initializer.
+///
+/// Modifying this property has the side effect of invalidating the
+/// ``NSTextAttachment/contents``, ``NSTextAttachment/fileType``, and
+/// ``NSTextAttachment/fileWrapper`` properties.
@property (nullable, strong, NS_NONATOMIC_IOSONLY) UIImage *image API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
-// Defines the layout bounds of the receiver's graphical representation in the text coordinate system. The origin is at the glyph location on the text baseline. The default value is CGRectZero.
+/// The layout bounds of the text attachment's graphical representation in the text coordinate system.
+///
+/// The bounds rectangle origin is at the current glyph location on the text
+/// baseline. The default value is
+/// <doc://com.apple.documentation/documentation/coregraphics/cgrectzero>.
@property (NS_NONATOMIC_IOSONLY) CGRect bounds API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
/**************************** Non-image contents properties ****************************/
-// Optionally, NSTextAttachment can be associated with a file wrapper. Modifying this property has a side effect of invalidating -image, -contents, and fileType properties.
+/// The text attachment's file wrapper.
+///
+/// The file wrapper holds the contents of the attached file. Modifying this
+/// property has a side effect of invalidating the ``NSTextAttachment/image``,
+/// ``NSTextAttachment/contents``, and ``NSTextAttachment/fileType`` properties.
@property (nullable, strong, NS_NONATOMIC_IOSONLY) NSFileWrapper *fileWrapper;
#pragma mark Advanced Layout Properties
-// Layout padding before and after the text attachment bounds. The layout and rendering bounds X origin gets inset by the padding value. This affects the relationship between the text attachment bounds. 0.0 by default
+/// The layout padding before and after the text attachment bounds.
+///
+/// The layout and rendering bounds X origin is inset by the padding value. This
+/// affects the relationship between the text attachment bounds and
+/// `NSLayoutManager` glyph metrics methods
+/// ``NSLayoutManager/location(forGlyphAt:)`` and
+/// ``NSLayoutManager/attachmentSize(forGlyphAt:)``. The default value is `0.0`.
@property CGFloat lineLayoutPadding API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0), visionos(1.0));
#pragma mark View-based attachments
-// Factory methods for defining the mapping between UTI and text attachment view provider class
+/// Returns the text attachment view provider class, if any, for the file type you specify.
+///
+/// - Parameters:
+/// - fileType: A <doc://com.apple.documentation/documentation/swift/string> that represents the file type.
+///
+/// - Returns: The text attachment view provider class, or `nil` if there is no class for the specified file type.
+ (nullable Class)textAttachmentViewProviderClassForFileType:(NSString *)fileType API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
+
+/// Registers a specific file type with the attachment view provider.
+///
+/// - Parameters:
+/// - textAttachmentViewProviderClass: The text attachment view provider class.
+/// - fileType: A <doc://com.apple.documentation/documentation/swift/string> that represents the file type.
+ (void)registerTextAttachmentViewProviderClass:(Class)textAttachmentViewProviderClass forFileType:(NSString *)fileType API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// When YES, the text attachment tries to use a text attachment view returned by -viewProviderForParentView:location:textContainer:. YES by default
+/// A Boolean value that indicates whether the text attachment tries to use a text attachment view provider.
+///
+/// When `true`, the text attachment tries to use a view provider returned by
+/// ``NSTextAttachmentLayout/viewProvider(for:location:textContainer:)``.
+/// Default is `true`.
@property BOOL allowsTextAttachmentView API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// Returns YES if the text attachment is configured to use text attachment views. By default, it checks -allowsTextAttachmentView, +textAttachmentViewClassForFileType:, and its contents
+/// A Boolean value that indicates whether the text attachment is configured to use text attachment view providers.
+///
+/// The default implementation of this property checks
+/// ``NSTextAttachment/allowsTextAttachmentView``,
+/// ``textAttachmentViewProviderClassForFileType:``, and ``contents``.
@property (readonly) BOOL usesTextAttachmentView API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
@end
@interface NSAttributedString (NSAttributedStringAttachmentConveniences)
-// A convenience method for creating an attributed string containing attachment using NSAttachmentCharacter as the base character.
+/// Returns an attributed string containing the specified attachment using `NSAttachmentCharacter` as the base character.
+ (NSAttributedString *)attributedStringWithAttachment:(NSTextAttachment *)attachment API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
-// A convenience method for creating an attributed string containing an attachment with attributes using NSAttachmentCharacter as the base character.
+/// Returns an attributed string containing the specified attachment with attributes using `NSAttachmentCharacter` as the base character.
+ (instancetype)attributedStringWithAttachment:(NSTextAttachment *)attachment attributes:(NSDictionary<NSAttributedStringKey, id> *)attributes API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0), visionos(2.0));
@end
+/// A container object that associates a text attachment at a particular document location with a view object.
+///
+/// Use `NSTextAttachmentViewProvider` when you need to represent document
+/// locations in terms of an ``NSTextLocation`` or an ``NSTextRange`` or you
+/// want to support view-based text attachments. The view provider controls the
+/// view placement and layout without requiring view classes to be aware of the
+/// text attachment coordination using a ``NSTextLayoutManager`` in macOS 12 or
+/// iOS 15 and later.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextAttachmentViewProvider : NSObject
+/// Creates a new text attachment view whose content starts at the location you provide.
+///
+/// - Parameters:
+/// - textAttachment: The ``NSTextAttachment`` for this view.
+/// - parentView: The parent view of this attachment.
+/// - textLayoutManager: The ``NSTextLayoutManager`` for this view.
+/// - location: The ``NSTextLocation`` that identifies the start of the text.
- (instancetype)initWithTextAttachment:(NSTextAttachment *)textAttachment parentView:(nullable UIView *)parentView textLayoutManager:(nullable NSTextLayoutManager *)textLayoutManager location:(id <NSTextLocation>)location NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
+/// The text attachment for this view.
+///
+/// Specify the value of this property at initialization time using the
+/// ``NSTextAttachmentViewProvider/init(textAttachment:parentView:textLayoutManager:location:)``
+/// initializer.
@property (readonly, weak) NSTextAttachment *textAttachment;
+
+/// The text layout manager for this view.
+///
+/// Specify the value of this property at initialization time using the
+/// ``NSTextAttachmentViewProvider/init(textAttachment:parentView:textLayoutManager:location:)``
+/// initializer.
@property (readonly, weak, nullable) NSTextLayoutManager *textLayoutManager;
+/// The location that indicates the start of the text attachment.
+///
+/// Specify the value of this property at initialization time using the
+/// ``NSTextAttachmentViewProvider/init(textAttachment:parentView:textLayoutManager:location:)``
+/// initializer.
@property (readonly, strong) id <NSTextLocation> location;
// View instantiation
-// The getter first invokes loadView if the view hasn't been set yet. Subclasses must call super if they override the setter or getter.
+/// The text attachment's view.
+///
+/// The getter first invokes ``loadView`` if the view hasn't been set yet.
+///
+/// > Important: Subclasses must call the superclass implementation if they
+/// override the setter or getter.
@property(nullable, strong) UIView *view;
-// This is where subclasses should create their custom view hierarchy. Should never be called directly.
+/// Creates the custom view hierarchy for this attachment.
+///
+/// Use this method to create a custom view hierarchy. Don't call this method
+/// directly; the framework calls it at the appropriate time.
- (void)loadView;
-// This property determines the text attachment bounds policy. If YES, -[NSTextAttachment attachmentBoundsForAttributes:location:textContainer:proposedLineFragment:position:] consults the text attachment view provider for determining the bounds instead of using -bounds. NO by default
+/// A Boolean value that determines the text attachment's bounds policy.
+///
+/// If `true`, the framework calls the `textAttachment` property's
+/// ``NSTextAttachmentViewProvider/attachmentBounds(for:location:textContainer:proposedLineFragment:position:)``
+/// method and examines the text attachment view provider to determine the
+/// bounds instead of using the `bounds` property of this instance. Defaults to
+/// `false`.
@property BOOL tracksTextAttachmentViewBounds;
-// Invoked from -[NSTextAttachment attachmentBoundsForAttributes:location:textContainer:proposedLineFragment:position:]
+/// Returns the layout bounds for an attachment at a specific text location that contains the text attributes you specify.
+///
+/// - Parameters:
+/// - attributes: A dictionary that contains a list of key and attribute pairs that describe the customization of the string.
+/// - location: An ``NSTextLocation`` that indicates the location of the attachment inside the document.
+/// - textContainer: The ``NSTextContainer`` that defines the area to fill in with text.
+/// - proposedLineFragment: A <doc://com.apple.documentation/documentation/corefoundation/cgrect> that describes the boundaries of the line fragment.
+/// - position: A <doc://com.apple.documentation/documentation/corefoundation/cgpoint> inside `proposedLineFragment`.
+///
+/// - Returns: A <doc://com.apple.documentation/documentation/corefoundation/cgrect> that describes the bounds of the attachment.
- (CGRect)attachmentBoundsForAttributes:(NSDictionary<NSAttributedStringKey, id> *)attributes location:(id <NSTextLocation>)location textContainer:(nullable NSTextContainer *)textContainer proposedLineFragment:(CGRect)proposedLineFragment position:(CGPoint)position;
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContainer.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContainer.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContainer.h 2026-06-01 00:35:01
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContainer.h 2026-06-18 00:04:27
@@ -18,49 +18,176 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
+/// A region where text layout occurs.
+///
+/// An ``NSLayoutManager`` or ``NSTextLayoutManager`` uses ``NSTextContainer``
+/// to determine where to break lines, lay out portions of text, and so on. An
+/// ``NSTextContainer`` object typically defines rectangular regions, but you
+/// can define exclusion paths inside the text container to create regions where
+/// text doesn't flow. You can also subclass to create text containers with
+/// nonrectangular regions, such as circular regions, regions with holes in
+/// them, or regions that flow alongside graphics.
+///
+/// You can access instances of the ``NSTextContainer``, ``NSLayoutManager``,
+/// and ``NSTextStorage`` classes from threads other than the main thread as
+/// long as the app guarantees access from only one thread at a time. The same
+/// restrictions apply to ``NSTextLayoutManager`` and ``NSTextContentStorage``.
UIKIT_EXTERN API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextContainer : NSObject <NSSecureCoding, NSTextLayoutOrientationProvider>
/**************************** Initialization ****************************/
+/// Initializes a text container with a specified bounding rectangle.
+///
+/// The new text container must be added to an ``NSLayoutManager`` or
+/// ``NSTextLayoutManager`` object before it can be used. The text container
+/// must also have an associated
+/// <doc://com.apple.documentation/documentation/appkit/nstextview> object for
+/// text to be displayed. This method is the designated initializer for the
+/// `NSTextContainer` class.
+///
+/// - Parameters:
+/// - size: The size of the text container's bounding rectangle.
+///
+/// ## See Also
+///
+/// - [Text Layout Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextLayout/TextLayout.html#//apple_ref/doc/uid/10000158i)
+/// - [Cocoa Text Architecture Guide](https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009459)
+/// - ``NSLayoutManager/addTextContainer(_:)``
+/// - [Text System Storage Layer Overview](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextStorageLayer/TextStorageLayer.html#//apple_ref/doc/uid/10000087i)
- (instancetype)initWithSize:(CGSize)size NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos);
+/// Creates a text container from data in an unarchiver.
+///
+/// - Parameters:
+/// - coder: A coder that conforms to <doc://com.apple.documentation/documentation/foundation/nscoder>.
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
-// Returns NSTextLayoutManager owning the text container. When non-nil, -layoutManager should be nil.
+/// The ``NSTextLayoutManager`` owning the text container.
+///
+/// When non-nil, the legacy `layoutManager` should be `nil`.
@property (weak, nullable, readonly, NS_NONATOMIC_IOSONLY) NSTextLayoutManager *textLayoutManager API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
/************************* Container shape properties *************************/
-// Default value: CGSizeZero Defines the maximum size for the layout area returned from -lineFragmentRectForProposedRect:writingDirection:remainingRect:. 0.0 and less means no limitation.
+/// The size of the text container's bounding rectangle.
+///
+/// This property defines the maximum size for the layout area returned from
+/// ``NSTextContainer/lineFragmentRect(forProposedRect:at:writingDirection:remaining:)``.
+/// A value of `0.0` or less means no limitation.
+///
+/// If you don't specify an explicit size when you initialize a text container,
+/// the system uses a default large size of (`10000000.0`, `10000000.0`).
@property (NS_NONATOMIC_IOSONLY) CGSize size API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// Default value: NSLineBreakByWordWrapping The line break mode defines the behavior of the last line inside the text container.
+/// The behavior of the last line inside the text container.
+///
+/// The ``NSLineBreakMode`` constants specify what happens when a line is too
+/// long for its container. For example, wrapping can occur on word boundaries
+/// (the default) or character boundaries, or the line can be clipped or
+/// truncated. The default value of this property is
+/// ``NSLineBreakMode/byWordWrapping``.
@property (NS_NONATOMIC_IOSONLY) NSLineBreakMode lineBreakMode API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// Default value : empty array An array of UIBezierPath representing the exclusion paths inside the receiver's bounding rect.
+/// An array of path objects that represents the regions where text doesn't display in the text container.
+///
+/// The default value is an empty array.
@property (copy, NS_NONATOMIC_IOSONLY) NSArray<UIBezierPath *> *exclusionPaths API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos);
/************************* Layout constraint properties *************************/
-// Default value: 5.0 The layout padding at the beginning and end of the line fragment rects insetting the layout width available for the contents. This value is utilized by NSLayoutManager for determining the layout width.
+/// The value for the text inset within line fragment rectangles.
+///
+/// The padding appears at the beginning and end of the line fragment
+/// rectangles. The layout manager and text layout manager use this value to
+/// determine the layout width. The default value of this property is `5.0`.
+///
+/// Line fragment padding is not designed to express text margins. Instead, you
+/// should use insets on your text view, adjust the paragraph margin attributes,
+/// or change the position of the text view within its superview.
+///
+/// ## See Also
+///
+/// - ``lineFragmentRect(forProposedRect:at:writingDirection:remaining:)``
@property (NS_NONATOMIC_IOSONLY) CGFloat lineFragmentPadding;
-// Default value: 0 (no limit) The maximum number of lines that can be stored in the receiver. This value is utilized by NSLayoutManager for determining the maximum number of lines associated with the text container.
+/// The maximum number of lines that the text container can store.
+///
+/// The layout manager and text layout manager use the value of this property to
+/// determine the maximum number of lines associated with the text container.
+/// The default value of this property is `0`, which indicates that there is no
+/// limit.
@property (NS_NONATOMIC_IOSONLY) NSUInteger maximumNumberOfLines API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos);
/**************************** Line fragments ****************************/
-// Returns the bounds of a line fragment rect inside the receiver for proposedRect. This is the intersection of proposedRect and the receiver's bounding rect defined by -size property. The regions defined by -exclusionPaths property are excluded from the return value. charIndex is the character location inside the text storage for the line fragment being processed. It is possible that proposedRect can be divided into multiple line fragments due to exclusion paths. In that case, remainingRect returns the remainder that can be passed in as the proposed rect for the next iteration. baseWritingDirection determines the direction of advancement for line fragments inside a visual horizontal line. The values passed into the method are either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft. This method can be overridden by subclasses for further text container region customization.
+/// Returns the bounds of a line fragment rectangle inside the text container for the proposed rectangle.
+///
+/// The bounds of the line fragment rectangle are determined by the intersection
+/// of `proposedRect` and the text container's bounding rectangle defined by its
+/// ``NSTextContainer/size`` property. The regions defined by the
+/// ``NSTextContainer/exclusionPaths`` property are excluded from the return
+/// value. It is possible that `proposedRect` can be divided into multiple line
+/// fragments due to exclusion paths. In that case, `remainingRect` returns the
+/// remainder that can be passed in as the proposed rectangle for the next
+/// iteration.
+///
+/// This method can be overridden by subclasses for further text container
+/// region customization.
+///
+/// - Parameters:
+/// - proposedRect: A rectangle in which to lay out text proposed by the layout manager or text layout manager.
+/// - characterIndex: The character location inside the text storage for the line fragment being processed.
+/// - baseWritingDirection: The direction of advancement for line fragments inside a visual horizontal line. The values passed into the method are either ``NSWritingDirection/leftToRight`` or ``NSWritingDirection/rightToLeft``.
+/// - remainingRect: The remainder of the proposed rectangle that was excluded from the returned rectangle. It can be passed in as the proposed rectangle for the next iteration.
+///
+/// - Returns: The bounds of the line fragment rect.
- (CGRect)lineFragmentRectForProposedRect:(CGRect)proposedRect atIndex:(NSUInteger)characterIndex writingDirection:(NSWritingDirection)baseWritingDirection remainingRect:(nullable CGRect *)remainingRect API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// Returns YES if the receiver is a rectangular shape defined simply by -size. TextKit utilizes this information for enabling various layout optimizations. NSLayoutManager disables non-contiguous layout when this property is NO. The default implementation returns NO when -exclusionPaths has 1 or more items, -maximumNumberOfLines is not 0, or -lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect: is overridden. It's recommended to override this property when -lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect: is overridden.
+/// A Boolean that indicates whether the text container's region is a rectangle with no holes or gaps, and whose edges are parallel to the text view's coordinate system axes.
+///
+/// The value of this property is
+/// <doc://com.apple.documentation/documentation/swift/true> when the text
+/// container's region is a rectangle with no holes or gaps and the edges are
+/// parallel to the text view's coordinate system axes. The default value of
+/// this property is <doc://com.apple.documentation/documentation/swift/false>
+/// when the ``NSTextContainer/exclusionPaths`` property contains one or more
+/// items, when the ``NSTextContainer/maximumNumberOfLines`` property is not
+/// zero, or when you override the
+/// ``NSTextContainer/lineFragmentRect(forProposedRect:at:writingDirection:remaining:)``
+/// method. Otherwise, the default value is
+/// <doc://com.apple.documentation/documentation/swift/true>.
@property (getter=isSimpleRectangularTextContainer, readonly, NS_NONATOMIC_IOSONLY) BOOL simpleRectangularTextContainer API_AVAILABLE(macos(10.0), ios(9.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos);
/**************************** View synchronization ****************************/
-// Default value: NO Define whether the text container view bounds changes can affect the text container size.
+/// A Boolean that controls whether the text container adjusts the width of its bounding rectangle when its text view resizes.
+///
+/// When the value of this property is
+/// <doc://com.apple.documentation/documentation/swift/true>, the text container
+/// adjusts its width when the width of its text view changes. The default value
+/// of this property is
+/// <doc://com.apple.documentation/documentation/swift/false>.
+///
+/// For more information about size tracking, see [Text System Storage Layer Overview](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextStorageLayer/TextStorageLayer.html#//apple_ref/doc/uid/10000087i).
+///
+/// ## See Also
+///
+/// - ``NSTextContainer/size``
@property (NS_NONATOMIC_IOSONLY) BOOL widthTracksTextView;
+/// A Boolean that controls whether the text container adjusts the height of its bounding rectangle when its text view resizes.
+///
+/// When the value of this property is
+/// <doc://com.apple.documentation/documentation/swift/true>, the text container
+/// adjusts its height when the height of its text view changes. The default
+/// value of this property is
+/// <doc://com.apple.documentation/documentation/swift/false>.
+///
+/// For more information about size tracking, see [Text System Storage Layer Overview](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextStorageLayer/TextStorageLayer.html#//apple_ref/doc/uid/10000087i).
+///
+/// ## See Also
+///
+/// - ``NSTextContainer/size``
@property (NS_NONATOMIC_IOSONLY) BOOL heightTracksTextView;
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContentManager.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContentManager.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContentManager.h 2026-05-29 22:58:32
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextContentManager.h 2026-06-18 00:02:40
@@ -23,134 +23,365 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
#pragma mark NSTextElementProvider
+/// Values that control the order in which the framework enumerates text elements.
typedef NS_OPTIONS(NSUInteger, NSTextContentManagerEnumerationOptions) {
+ /// The value that represents no custom enumeration handling.
NSTextContentManagerEnumerationOptionsNone = 0,
+ /// Causes enumerations to start from the end of the text element.
NSTextContentManagerEnumerationOptionsReverse = (1 << 0)
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// NSTextElementProvider is a protocol conformed by NSTextContentManager and its concrete subclasses. It defines the base interface for interacting with a custom text document content type.
+/// A protocol the text content manager and its concrete subclasses conform to, which defines the interface for interacting with custom content types of a text document.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@protocol NSTextElementProvider <NSObject>
-// Declares the starting and ending locations for the document. The subclass could use its own implementation of a location object conforming to NSTextRange.
+/// The starting and ending locations for the document.
+///
+/// The subclass could use its own implementation of a location object conforming
+/// to ``NSTextLocation``.
@property (strong, readonly) NSTextRange *documentRange;
-// Enumerates the text elements starting at textLocation. If textLocation=nil, it assumes self.documentRange.location for forward enumeration; uses self.documentRange.endLocation for reverse enumeration. When enumerating backward, it starts with the element preceding the one containing textLocation. If enumerated at least one element, it returns the edge of the enumerated range. Note that the enumerated range might not match the range of the last element returned. It enumerates the elements in the sequence, but it can skip a range (it can limit the maximum number of text elements enumerated for a single invocation or hide some elements from the layout). Returning NO from block breaks out of the enumeration.
+/// Enumerates text elements starting at the text location you provide.
+///
+/// If `textLocation` is `nil`, the method uses `documentRange.location` for
+/// forward enumeration and `documentRange.endLocation` for reverse enumeration.
+/// When enumerating backward, the method starts with the element preceding the
+/// one containing `textLocation`. If enumerated at least one element, it
+/// returns the edge of the enumerated range.
+///
+/// The enumerated range might not match the range of the last element returned.
+/// It enumerates the elements in the sequence, but it can skip a range (it can
+/// limit the maximum number of text elements enumerated for a single invocation
+/// or hide some elements from the layout).
+///
+/// Subclasses are responsible for caching the ``NSTextElement`` objects they return.
+/// The text layout system uses weak references to track elements internally, and elements that are deallocated without explicit layout invalidation may cause layout fragments to lose their content association.
+///
+/// Returning `false` from block breaks out of the enumeration.
+///
+/// - Parameters:
+/// - textLocation: The ``NSTextLocation`` at which to start the enumeration.
+/// - options: One of the possible `NSTextContentManagerEnumerationOptions` directions.
+/// - block: A block called for each enumerated text element. Return `false` to end the enumeration process.
+///
+/// - Returns: An ``NSTextLocation`` representing the edge of the enumerated range.
- (nullable id <NSTextLocation>)enumerateTextElementsFromLocation:(nullable id <NSTextLocation>)textLocation options:(NSTextContentManagerEnumerationOptions)options usingBlock:(BOOL (NS_NOESCAPE ^)(NSTextElement *element))block;
-// Replaces the characters specified by range with textElements. If the edges of range is not at existing element range boundaries, it either split the element if it allows the operation (i.e. NSTextParagraph) or adjust the replacement range. This method is intended to be used only by NSTextLayoutManager.
+/// Replaces the characters specified by range with the text elements you provide.
+///
+/// If the edges of `range` aren't at existing element range boundaries, the
+/// method either splits the element if it allows the operation (for example,
+/// ``NSTextParagraph``), or adjusts the replacement range.
+///
+/// > Note:
+/// > This method is for use by ``NSTextLayoutManager``.
+///
+/// - Parameters:
+/// - range: An ``NSTextRange``.
+/// - textElements: The elements to replace the characters at `range`.
- (void)replaceContentsInRange:(NSTextRange *)range withTextElements:(nullable NSArray<NSTextElement *> *)textElements;
-// Synchronizes changes to the backing store. If completionHandler=nil, performs the operation synchronously. completionHandler gets passed error if failed. It should block (or fail if synchronous) when there is an active transaction.
+/// Synchronizes changes to the backing store.
+///
+/// If `completionHandler` is `nil`, performs the operation synchronously. The
+/// `completionHandler` gets passed `error` if the synchronization fails. It
+/// should block (or fail if synchronous) when there's an active transaction.
+///
+/// - Parameters:
+/// - completionHandler: A completion handler to run upon successful completion, or to process an error upon failure.
- (void)synchronizeToBackingStore:(nullable void (^)(NSError * _Nullable error))completionHandler;
@optional
-// Returns a new location from location with offset. The offset value could be positive or negative indicating the logical direction. Could return nil when the inputs don't produce any legal location (i.e. out of bounds index).
+/// Returns a new location from location with the offset you provide.
+///
+/// The offset value could be positive or negative indicating the logical
+/// direction. Could return `nil` when the inputs don't produce any legal
+/// location (i.e. out of bounds index).
+///
+/// - Parameters:
+/// - location: An ``NSTextLocation`` in the text element.
+/// - offset: An offset of the number of characters to or from `location`.
+///
+/// - Returns: A new ``NSTextLocation``, or `nil` if the offset exceeds the bounds of the text.
- (nullable id <NSTextLocation>)locationFromLocation:(id <NSTextLocation>)location withOffset:(NSInteger)offset;
-// Returns the offset between from and to. The return value could be positive or negative. Could return NSNotFound when the offset cannot be represented in an integer value (i.e. locations are not in the same document).
+/// Returns the offset between the two specified locations.
+///
+/// The return value could be positive or negative. This method can return
+/// <doc://com.apple.documentation/documentation/foundation/nsnotfound> when the
+/// method can't represent an offset as an integer value. This can occur, for
+/// example, if the locations aren't in the same document.
+///
+/// - Parameters:
+/// - from: A starting location.
+/// - to: An ending location.
+///
+/// - Returns: An integer that represents the offset between the starting and ending locations.
- (NSInteger)offsetFromLocation:(id <NSTextLocation>)from toLocation:(id <NSTextLocation>)to;
-// Should be implemented if the location backing store requires manual adjustment after editing. When textRange is intersecting or following the current edited range, the method returns the range adjusted for the modification in the editing session. Returns nil, when no adjustment necessary. forEditingTextSelection indicates if textRange is for the text selection associated with the edit session.
+/// A method you implement if the location backing store requires manual adjustment after editing.
+///
+/// When `textRange` is intersecting or following the current edited range, the
+/// method returns the range adjusted for the modification in the editing
+/// session. Returns `nil` when no adjustment is necessary.
+///
+/// - Parameters:
+/// - textRange: An ``NSTextRange`` that the method adjusts.
+/// - forEditingTextSelection: A Boolean value that indicates if `textRange` is for the text selection associated with the edit session.
+///
+/// - Returns: The adjusted range, or `nil` when no adjustment is necessary.
- (nullable NSTextRange *)adjustedRangeFromRange:(NSTextRange *)textRange forEditingTextSelection:(BOOL)forEditingTextSelection;
@end
#pragma mark NSTextContentManager
-// NSTextContentManager is an abstract class defining the interface for managing the text document contents and the default implementation. The concrete subclass overrides NSTextElementProvider for managing the content backing store. It is the root object strongly referencing the rest of objects in the TextKit network via an array of NSTextLayoutManager. Also, it manages the editing transaction by tracking the active NSTextLayoutManager focused to be editing.
+/// An abstract class that defines the interface and a default implementation for managing the text document contents.
+///
+/// The concrete subclass overrides ``NSTextElementProvider`` for managing the
+/// content backing store. It is the root object that strongly references the
+/// rest of objects in the TextKit network via an array of
+/// ``NSTextLayoutManager``. It manages the editing transaction by tracking the
+/// ``NSTextLayoutManager`` that is active and focused for editing.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextContentManager : NSObject <NSTextElementProvider, NSSecureCoding>
#pragma mark Initialization
+/// Creates a new content manager.
- (instancetype)init NS_DESIGNATED_INITIALIZER;
+/// Creates a new content manager object from data in an unarchiver.
+///
+/// - Parameters:
+/// - coder: An unarchiver that conforms to the <doc://com.apple.documentation/documentation/foundation/nscoder> class.
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
#pragma mark Basic properties
+/// The delegate for the content manager object.
@property (weak, nullable) id <NSTextContentManagerDelegate> delegate;
#pragma mark NSTextLayoutManager management
-// An array of NSTextLayoutManager. KVO-compliant
+/// The array of text layout managers associated with this text content manager.
+///
+/// This property is KVO-compliant.
@property (copy, readonly) NSArray<NSTextLayoutManager *> *textLayoutManagers;
+/// Adds the text layout manager you provide to the list of layout managers.
+///
+/// - Parameters:
+/// - textLayoutManager: The text layout manager to add.
- (void)addTextLayoutManager:(NSTextLayoutManager *)textLayoutManager;
+/// Removes the text layout manager you specify from the list of layout managers.
+///
+/// - Parameters:
+/// - textLayoutManager: The text layout manager to remove.
- (void)removeTextLayoutManager:(NSTextLayoutManager *)textLayoutManager;
-// The primary NSTextLayoutManager interacting with the user allowing to edit. Setting an NSTextLayoutManager not in textLayoutManagers will reset to nil. It automatically synchronizes pending edits before switching to a new primary object. The operation is synchronous. KVO-compliant
+/// The primary text layout manager for this content.
+///
+/// The primary ``NSTextLayoutManager`` interacts with the user, allowing edits.
+/// Setting this property to an ``NSTextLayoutManager`` not in
+/// ``textLayoutManagers`` resets it to `nil`. It automatically synchronizes
+/// pending edits before switching to a new primary object. The operation is
+/// synchronous.
+///
+/// This property is KVO-compliant.
@property (nullable, strong) NSTextLayoutManager *primaryTextLayoutManager;
-// Synchronizes changes to all non-primary text layout managers. If completionHandler=nil, performs the operation synchronously. completionHandler gets passed error if failed. It should block (or fail if synchronous) when there is an active transaction.
+/// Synchronizes changes to all nonprimary text layout managers.
+///
+/// If `completionHandler` is `nil`, this method performs the operation
+/// synchronously. The framework passes any error to the `completionHandler`.
+/// The method blocks (or fails, if synchronous) when there's an active
+/// transaction.
+///
+/// - Parameters:
+/// - completionHandler: A completion handler that runs on success, or to handle error conditions.
- (void)synchronizeTextLayoutManagers:(nullable void (^)(NSError * _Nullable error))completionHandler;
#pragma mark Element access
-// Returns an array of NSTextElement intersecting the specified range in sequence. It can return a set of elements not filling the entire range specified if the entire range is not synchronously available. Uses -enumerateTextElementsFromLocation:options:usingBlock: to fill the array.
+/// Returns an array of text elements that intersect with the range you specify.
+///
+/// This method can return a set of elements that don't fill the entire range if
+/// the entire range isn't synchronously available. Uses
+/// ``NSTextElementProvider/enumerateTextElements(from:options:using:)`` to fill
+/// the array.
+///
+/// - Parameters:
+/// - range: An ``NSTextRange`` that describes the range of text to process.
+///
+/// - Returns: An array of ``NSTextElement``.
- (NSArray<NSTextElement *> *)textElementsForRange:(NSTextRange *)range;
#pragma mark Transaction
-// When YES, there is an active editing transaction from primaryTextLayoutManager. the synchronization operations to non-primary text layout managers and the backing store block (or fails when synchronous) while this property is YES. Non-primary text layout managers should avoid accessing the elements while this is YES. KVO-compliant
+/// Indicates there's an active editing transaction from the primary text layout manager.
+///
+/// The synchronization operations to non-primary text layout managers and the
+/// backing store block (or fail when synchronous) while this property is `true`.
+/// Non-primary text layout managers should avoid accessing the elements while
+/// this is `true`. KVO-compliant.
@property (readonly) BOOL hasEditingTransaction;
-// Invoked by primaryTextLayoutManager controlling the active editing transaction. Can be nested. The outer most transaction toggles hasEditingTransaction and sends synchronization messages if enabled after invoking transaction.
+/// Performs an editing transaction and invokes a block upon completion.
+///
+/// Invoked by ``primaryTextLayoutManager`` controlling the active editing
+/// transaction. Can be nested. The outermost transaction toggles
+/// ``hasEditingTransaction`` and sends synchronization messages if enabled after
+/// invoking `transaction`.
+///
+/// - Parameters:
+/// - transaction: The block to execute within the editing transaction.
- (void)performEditingTransactionUsingBlock:(void (NS_NOESCAPE ^) (void))transaction NS_SWIFT_DISABLE_ASYNC;
-// Records information about an edit action to the transaction. originalTextRange is the range edited before the action, and newTextRange is the corresponding range after the action. The concrete subclass should invoke this method for each edit action.
+/// Records information about an edit action to the transaction.
+///
+/// `originalTextRange` is the range edited before the action, and
+/// `newTextRange` is the corresponding range after the action. The concrete
+/// subclass should invoke this method for each edit action.
+///
+/// - Parameters:
+/// - originalTextRange: The range before the edit.
+/// - newTextRange: The corresponding range after the edit.
- (void)recordEditActionInRange:(NSTextRange *)originalTextRange newTextRange:(NSTextRange *)newTextRange;
-// Automatically synchronizes all text layout managers when hasEditingTransaction becoming NO. YES by default.
+/// Determines if the framework should automatically synchronize all text layout managers when exiting an editing transaction.
+///
+/// The default value is `true`.
@property BOOL automaticallySynchronizesTextLayoutManagers;
-// Automatically synchronizes the backing store when hasEditingTransaction becoming NO. NO by default.
+/// Determines whether to automatically synchronize with the backing store when an editing transaction finishes.
+///
+/// The default value is `false`.
@property BOOL automaticallySynchronizesToBackingStore;
@end
#pragma mark NSTextContentManagerDelegate
+/// The optional methods that delegates of content manager objects implement for customizing or validating text elements.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@protocol NSTextContentManagerDelegate <NSObject>
@optional
-// Returns a custom element for location. When non-nil, textContentManager uses the element instead of creating based on its standard mapping logic.
+/// Returns a custom element for the specified location.
+///
+/// When non-nil, `textContentManager` uses the element instead of creating one
+/// based on its standard mapping logic.
- (nullable NSTextElement *)textContentManager:(NSTextContentManager *)textContentManager textElementAtLocation:(id <NSTextLocation>)location;
-// Gives delegate a chance to validate textElement right before block() invocation with -enumerateTextElementsFromLocation:options:usingBlock:. Returning NO indicates textElement to be skipped from the enumeration.
+/// Gives the delegate a chance to validate a text element before enumeration.
+///
+/// Returning `false` indicates the text element should be skipped from the enumeration.
- (BOOL)textContentManager:(NSTextContentManager *)textContentManager shouldEnumerateTextElement:(NSTextElement *)textElement options:(NSTextContentManagerEnumerationOptions)options;
@end
#pragma mark NSTextContentStorageDelegate
+/// The optional methods that delegates of content storage objects implement to handle content processing.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@protocol NSTextContentStorageDelegate <NSTextContentManagerDelegate>
@optional
-// Returns a custom NSTextParagraph for range in NSTextContentStorage.attributedString. When non-nil, textContentStorage uses the text paragraph instead of creating the standard NSTextParagraph with the attributed substring in range. The attributed string for a custom text paragraph must have range.length.
+/// Returns a custom `NSTextParagraph` for the specified range in the content storage's attributed string.
+///
+/// When non-nil, `textContentStorage` uses the text paragraph instead of
+/// creating the standard ``NSTextParagraph`` with the attributed substring in
+/// range. The attributed string for a custom text paragraph must have
+/// `range.length`.
- (nullable NSTextParagraph *)textContentStorage:(NSTextContentStorage *)textContentStorage textParagraphWithRange:(NSRange)range;
@end
#pragma mark NSTextContentStorage
-// NSTextContentStorage is a concrete subclass of NSTextContentManager providing support for NSAttributedString backing-store. It also implements NSTextStorageObserving participating as a client of NSTextStorage. The facility only supports a single NSTextContentStorage associated with a text storage. When -textStorage!=nil, -attributedString is ignored. By default, NSTextContentStorage is initialized with NSTextStorage as the backing-store.
+/// A concrete object for managing the document's text content and generating the text elements necessary for layout.
+///
+/// An ``NSTextContentStorage`` object provides the backing store for document
+/// content. It stores the text in an attributed string object, and defaults to
+/// using an ``NSTextStorage`` object. It also maps portions of the text to
+/// ``NSTextElement`` objects to organize the text into paragraphs, lists, and
+/// other common element types found in text content. During layout, TextKit
+/// uses these elements to lay out and render the content into one or more
+/// rendering surfaces.
+///
+/// `NSTextContentStorage` is a concrete subclass of ``NSTextContentManager``
+/// providing support for `NSAttributedString` backing store. It also implements
+/// `NSTextStorageObserving` participating as a client of `NSTextStorage`. The
+/// facility only supports a single `NSTextContentStorage` associated with a text
+/// storage. When ``NSTextStorage`` is non-nil, ``attributedString`` is ignored.
+/// By default, `NSTextContentStorage` is initialized with `NSTextStorage` as
+/// the backing store.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextContentStorage : NSTextContentManager <NSTextStorageObserving>
#pragma mark Basic properties
+/// The delegate for the content storage object.
@property (weak, nullable) id <NSTextContentStorageDelegate> delegate;
-// When YES, NSTextContentStorage assumes the paragraph with NSTextList includes the text list marker string. Utilizes NSTextList.includesTextListMarkers as the default value.
+/// When `true`, `NSTextContentStorage` assumes the paragraph with `NSTextList` includes the text list marker string.
+///
+/// Utilizes `NSTextList.includesTextListMarkers` as the default value.
@property BOOL includesTextListMarkers API_AVAILABLE(macos(26.0), ios(26.0), tvos(26.0), visionos(26.0)) API_UNAVAILABLE(watchos);
#pragma mark Document contents
-// The document contents. KVO-compliant
+/// An attributed string that contains the contents of the document.
+///
+/// KVO-compliant.
@property (nullable, copy) NSAttributedString *attributedString;
#pragma mark NSAttributedString utils
-// Returns a new attributed string for textElement. Returns if textElement cannot be mapped to NSAttributedString.
+/// Returns a new attributed string for the text element.
+///
+/// Returns `nil` if `textElement` cannot be mapped to `NSAttributedString`.
+///
+/// - Parameters:
+/// - textElement: The text element to convert.
+///
+/// - Returns: An attributed string representation, or `nil` if unmappable.
- (nullable NSAttributedString *)attributedStringForTextElement:(NSTextElement *)textElement;
-// Returns NSTextElement corresponding to attributedString. Returns nil when attributedString contains attributes not mappable to NSTextElement.
+/// Returns the text element corresponding to the attributed string.
+///
+/// Returns `nil` when `attributedString` contains attributes not mappable to
+/// ``NSTextElement``.
+///
+/// - Parameters:
+/// - attributedString: The attributed string to convert.
+///
+/// - Returns: A text element, or `nil` if the attributes are unmappable.
- (nullable NSTextElement *)textElementForAttributedString:(NSAttributedString *)attributedString;
#pragma mark Optional NSTextElementProvider methods
-// Returns a new location from location with offset. The offset value could be positive or negative indicating the logical direction. Could return nil when the inputs don't produce any legal location (i.e. out of bounds index).
+/// Returns a new text location object based on an existing location and offset you provide.
+///
+/// The offset value could be positive or negative indicating the logical
+/// direction. Could return `nil` when the inputs don't produce any legal
+/// location (i.e. out of bounds index).
+///
+/// - Parameters:
+/// - location: The base location.
+/// - offset: The offset from the base location.
+///
+/// - Returns: A new location, or `nil` if the result would be out of bounds.
- (nullable id <NSTextLocation>)locationFromLocation:(id <NSTextLocation>)location withOffset:(NSInteger)offset;
-// Returns the offset between from and to. The return value could be positive or negative. Could return NSNotFound when the offset cannot be represented in an integer value (i.e. locations are not in the same document).
+/// Returns the number of characters between the specified locations.
+///
+/// The return value could be positive or negative. Could return `NSNotFound`
+/// when the offset cannot be represented in an integer value (i.e. locations
+/// are not in the same document).
+///
+/// - Parameters:
+/// - from: The starting location.
+/// - to: The ending location.
+///
+/// - Returns: The signed offset, or <doc://com.apple.documentation/documentation/foundation/nsnotfound> if the locations are not in the same document.
- (NSInteger)offsetFromLocation:(id <NSTextLocation>)from toLocation:(id <NSTextLocation>)to;
-// Should be implemented if the location backing store requires manual adjustment after editing. When textRange is intersecting or following the current edited range, the method returns the range adjusted for the modification in the editing session. Returns nil, when no adjustment necessary. forEditingTextSelection indicates if textRange is for the text selection associated with the edit session.
+/// Returns the text range, if any, in the backing store that required manual adjustment after editing.
+///
+/// Should be implemented if the location backing store requires manual
+/// adjustment after editing. When `textRange` is intersecting or following the
+/// current edited range, the method returns the range adjusted for the
+/// modification in the editing session. Returns `nil` when no adjustment is
+/// necessary.
+///
+/// - Parameters:
+/// - textRange: The range to adjust.
+/// - forEditingTextSelection: Indicates if `textRange` is for the text selection associated with the edit session.
+///
+/// - Returns: The adjusted range, or `nil` if no adjustment is necessary.
- (nullable NSTextRange *)adjustedRangeFromRange:(NSTextRange *)textRange forEditingTextSelection:(BOOL)forEditingTextSelection;
@end
-// Posted by NSTextContentStorage when a text attribute unsupported by NSTextContentStorage is added to the underlying text storage.
+/// Posted by `NSTextContentStorage` when a text attribute unsupported by `NSTextContentStorage` is added to the underlying text storage.
UIKIT_EXTERN NSNotificationName NSTextContentStorageUnsupportedAttributeAddedNotification API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
NS_HEADER_AUDIT_END(nullability, sendability)
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextElement.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextElement.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextElement.h 2026-05-30 22:15:06
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextElement.h 2026-06-18 01:49:53
@@ -14,44 +14,70 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
-// NSTextElement is an abstract base class for representing the smallest text layout unit typically paragraphs, tables, or attachments. A text element is associated with an NSTextContentManager.
+/// An abstract base class that represents the smallest units of text layout such as paragraphs or attachments.
+///
+/// A text element is associated with an ``NSTextContentManager``.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextElement : NSObject
#pragma mark Initialization
+/// Creates a new text element with the content manager you provide.
+///
+/// - Parameters:
+/// - textContentManager: The content manager to associate with this element.
- (instancetype)initWithTextContentManager:(nullable NSTextContentManager *)textContentManager NS_DESIGNATED_INITIALIZER;
#pragma mark Properties
-// Returns the owner NSTextContentManager. A text element can migrate between text content managers.
+/// The value that represents the current content manager.
+///
+/// A text element can migrate between text content managers.
@property (nullable, weak) NSTextContentManager *textContentManager;
-// Represents the range of the element inside the document.
+/// A range value that represents the range of the element inside the document.
@property (nullable, strong) NSTextRange *elementRange;
#pragma mark Child Elements
-// A concrete NSTextElement subclass can be structured in a tree. An element can have zero or more child elements. This section provides interface for supporting such a configuration.
-// Returns an array of children. The array can contain zero or more elements.
+/// An array of zero or more child text elements.
+///
+/// A concrete `NSTextElement` subclass can be structured in a tree. An element
+/// can have zero or more child elements.
@property (readonly, copy) NSArray<__kindof NSTextElement *> *childElements API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// Returns the parent element if the receiver is a child.
+/// A value that represents the parent element if this text element is a child of an enclosing element.
@property (nullable, readonly, weak) __kindof NSTextElement *parentElement API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// Returns YES if it is an element represented in text layout. It is enumerated by NSTextContentManager.
+/// A Boolean value that indicates whether this element is in the text layout.
+///
+/// When `true`, the element is enumerated by ``NSTextContentManager``.
@property (readonly) BOOL isRepresentedElement API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), visionos(1.0)) API_UNAVAILABLE(watchos);
@end
#pragma mark NSTextParagraph
-// NSTextParagraph represents a single paragraph backed by NSAttributedString as the contents.
+/// A class that represents a single paragraph backed by an attributed string as the contents.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextParagraph : NSTextElement
#pragma mark Initialization
+/// Creates a new paragraph with the attributed string you provide.
+///
+/// - Parameters:
+/// - attributedString: The attributed string for the paragraph contents.
- (instancetype)initWithAttributedString:(nullable NSAttributedString *)attributedString NS_DESIGNATED_INITIALIZER;
#pragma mark Contents
+/// The source attributed string.
@property (strong, readonly) NSAttributedString *attributedString;
-// The paragraph ranges are derived from elementRange and attributedString.
+/// The range of the paragraph's content within the document.
+///
+/// The paragraph's content is the text up to but not including the paragraph
+/// separator. Together with ``paragraphSeparatorRange``, this range covers the
+/// entire ``NSTextElement/elementRange``.
@property (nullable, strong, readonly) NSTextRange *paragraphContentRange;
+
+/// The range of the paragraph separator within the document.
+///
+/// Together with ``paragraphContentRange``, this range covers the entire
+/// ``NSTextElement/elementRange``.
@property (nullable, strong, readonly) NSTextRange *paragraphSeparatorRange;
@end
NS_HEADER_AUDIT_END(nullability, sendability)
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLayoutFragment.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLayoutFragment.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLayoutFragment.h 2026-05-29 22:58:31
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLayoutFragment.h 2026-06-18 01:49:53
@@ -21,90 +21,170 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
-// NSTextLayoutFragment represents the layout fragment typically corresponding to a rendering surface such as CALayer or UIView/NSView subclasses.
+/// A class that represents the layout fragment typically corresponding to a rendering surface, such as a layer or view subclass.
+/// Values that describe options for enumerating text layout fragments.
typedef NS_OPTIONS(NSUInteger, NSTextLayoutFragmentEnumerationOptions) {
+ /// The value that represents no selected enumeration options.
NSTextLayoutFragmentEnumerationOptionsNone = 0,
+ /// Enumerates in reverse from the layout fragment before the one containing this location.
NSTextLayoutFragmentEnumerationOptionsReverse = (1 << 0),
- NSTextLayoutFragmentEnumerationOptionsEstimatesSize = (1 << 1), // When enumerating, the layout fragments will be asked to estimate their size.
- NSTextLayoutFragmentEnumerationOptionsEnsuresLayout = (1 << 2), // When enumerating, the layout fragments will be asked to layout.
- NSTextLayoutFragmentEnumerationOptionsEnsuresExtraLineFragment = (1 << 3), // It synthesizes the extra line fragment when necessary.
+ /// When enumerating, tells the layout fragments to estimate their size.
+ NSTextLayoutFragmentEnumerationOptionsEstimatesSize = (1 << 1),
+ /// When enumerating, tells the layout fragments to lay out their contents.
+ NSTextLayoutFragmentEnumerationOptionsEnsuresLayout = (1 << 2),
+ /// Synthesizes the extra line fragment when necessary.
+ NSTextLayoutFragmentEnumerationOptionsEnsuresExtraLineFragment = (1 << 3),
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
+/// Values that describe the possible layout states of a text layout fragment.
typedef NS_ENUM(NSUInteger, NSTextLayoutFragmentState) {
- NSTextLayoutFragmentStateNone = 0, // No layout information
- NSTextLayoutFragmentStateEstimatedUsageBounds = 1, // When associated with NSTextLayoutManager, filled with an estimated rect if no layout
- NSTextLayoutFragmentStateCalculatedUsageBounds = 2, // layout fragment measurements available without textLineFragments
- NSTextLayoutFragmentStateLayoutAvailable = 3 // textLineFragments and layout fragment measurements available
+ /// No layout information is available.
+ NSTextLayoutFragmentStateNone = 0,
+ /// The text layout manager hasn't performed a full layout yet for the region covered by this layout fragment and is returning estimated bounds.
+ NSTextLayoutFragmentStateEstimatedUsageBounds = 1,
+ /// The layout fragment measurements are available without text line fragments.
+ NSTextLayoutFragmentStateCalculatedUsageBounds = 2,
+ /// Measurements for the text line fragments and layout fragment are available.
+ NSTextLayoutFragmentStateLayoutAvailable = 3
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextLayoutFragment : NSObject <NSSecureCoding, NSTextViewportRenderingSurfaceKey>
#pragma mark Initialization
+/// Creates a new layout fragment using the provided text element and range.
+///
+/// - Parameters:
+/// - textElement: The text element for this layout fragment.
+/// - rangeInElement: The range inside the text element, or `nil` for the entire element.
- (instancetype)initWithTextElement:(NSTextElement *)textElement range:(nullable NSTextRange *)rangeInElement NS_DESIGNATED_INITIALIZER;
+/// Creates a new layout fragment with the coder you provide.
+///
+/// - Parameters:
+/// - coder: A coder that conforms to <doc://com.apple.documentation/documentation/foundation/nscoder>.
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark Properties
+/// The text layout manager for this text layout fragment.
@property (nullable, weak, readonly) NSTextLayoutManager *textLayoutManager;
#pragma mark Contents
-// The parent text element
+/// The parent text element.
@property (weak, readonly) NSTextElement *textElement;
-// range inside textElement relative to the document origin
+/// The range inside the text element relative to the document origin.
@property (strong, readonly) NSTextRange *rangeInElement;
#pragma mark Layout
-// An array of NSTextLineFragments. Valid when NSTextLayoutFragmentStateLayoutAvailable. KVO-compliant
+/// An array of text line fragments.
+///
+/// Valid when ``state`` is `NSTextLayoutFragmentStateLayoutAvailable`.
+/// KVO-compliant.
@property (copy, readonly) NSArray<NSTextLineFragment *> *textLineFragments;
-// Returns the NSTextLineFragment containing verticalOffset if found. When requiresExactMatch=NO, it returns the closest line fragment beyond verticalOffset if no line fragment contains verticalOffset.
+/// Returns the text line fragment for the vertical offset you provide, or the closest text line fragment beyond the vertical offset.
+///
+/// Set `requiresExactMatch` to `true` to find the text line fragment that
+/// contains the vertical offset, or set `requiresExactMatch` to `false` to find
+/// the closest text line fragment matching or beyond the vertical offset.
+/// Returns `nil` if there isn't a match.
+///
+/// - Parameters:
+/// - verticalOffset: The vertical offset to search for.
+/// - requiresExactMatch: When `false`, returns the closest line fragment beyond `verticalOffset` if no line fragment contains it.
+///
+/// - Returns: The matching line fragment, or `nil`.
- (nullable NSTextLineFragment *)textLineFragmentForVerticalOffset:(CGFloat)verticalOffset requiresExactMatch:(BOOL)requiresExactMatch API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// Returns the NSTextLineFragment containing textLocation. When isUpstreamAffinity=YES, it returns the text line fragment ending at textLocation.
+/// Returns a text line fragment from a specific text location in the document.
+///
+/// Set `isUpstreamAffinity` to `true` to find a text fragment by its element
+/// range end location, such as when you enumerate over line fragments in
+/// reverse order. Set `isUpstreamAffinity` to `false` to find a text fragment that
+/// contains `textLocation`.
+///
+/// - Parameters:
+/// - textLocation: The text location to search for.
+/// - isUpstreamAffinity: When the location is at the end of a text line fragment (and the beginning of another), `true` chooses the one ending with the location; `false` chooses the following.
+///
+/// - Returns: The matching line fragment, or `nil`.
- (nullable NSTextLineFragment *)textLineFragmentForTextLocation:(id <NSTextLocation>)textLocation isUpstreamAffinity:(BOOL)isUpstreamAffinity API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// When non-nil, the layout operation is dispatched to the queue asynchronously.
+/// The queue on which the framework dispatches layout operations.
+///
+/// When non-nil, the layout operation is dispatched to the queue asynchronously.
@property (nullable, strong) NSOperationQueue *layoutQueue;
-// The layout information state. KVO-compliant
+/// The layout information state.
+///
+/// KVO-compliant.
@property (readonly) NSTextLayoutFragmentState state;
-// Invalidates any layout information associated with the receiver
+/// Invalidates any layout information associated with the text layout fragment.
- (void)invalidateLayout;
#pragma mark Layout information
-// The rect for tiling the layout fragment inside the target layout coordinate system typically in an NSTextContainer.
+/// The rectangle the framework uses for tiling the layout fragment inside the target layout coordinate system.
+///
+/// Typically in an ``NSTextContainer`` coordinate system.
@property (readonly) CGRect layoutFragmentFrame;
-// The bounds defining the area required for rendering the contents. The coordinate system is relative to the layoutFragmentFrame. The coordinate system is vertically flipped, meaning origin ({0,0} is at the upper-left corner). The size should be larger than layoutFragmentFrame.size. The origin could be in the negative coordinate since the rendering could be stretched out of layoutFragmentFrame. Only valid when state > NSTextLayoutFragmentStateEstimatedUsageBounds.
+/// The bounds defining the area required for rendering the contents.
+///
+/// The coordinate system is relative to ``layoutFragmentFrame``. The coordinate
+/// system is vertically flipped, meaning origin (`{0,0}`) is at the upper-left
+/// corner. The size should be larger than `layoutFragmentFrame.size`. The origin
+/// could be in the negative coordinate since the rendering could be stretched
+/// out of `layoutFragmentFrame`. Only valid when ``state`` is greater than
+/// `NSTextLayoutFragmentStateEstimatedUsageBounds`.
@property (readonly) CGRect renderingSurfaceBounds;
#pragma mark Custom spacing
-// The amount of margin space reserved during paragraph layout between the leading edge of the text layout fragment (according to the primary writing direction of the paragraph) and the start of the lines in the paragraph.
+/// The amount of margin space reserved during paragraph layout between the leading edge of the text layout fragment and the start of the lines in the paragraph.
+///
+/// The leading edge is according to the primary writing direction of the paragraph.
@property (readonly) CGFloat leadingPadding;
-// The amount of margin space reserved during paragraph layout between the end of the lines in the paragraph and the trailing edge of the text layout fragment (according to the primary writing direction of the paragraph).
+/// The amount of margin space reserved during paragraph layout between the end of the lines in the paragraph and the trailing edge of the text layout fragment.
+///
+/// The trailing edge is according to the primary writing direction of the paragraph.
@property (readonly) CGFloat trailingPadding;
-// The amount of space reserved during paragraph layout between the top of the text layout fragment and the top of the first line in the paragraph.
+/// The amount of space reserved during paragraph layout between the top of the text layout fragment and the top of the first line in the paragraph.
@property (readonly) CGFloat topMargin;
-// The amount of space reserved during paragraph layout between the bottom of the last line in the paragraph and the bottom of the text layout fragment.
+/// The amount of space reserved during paragraph layout between the bottom of the last line in the paragraph and the bottom of the text layout fragment.
@property (readonly) CGFloat bottomMargin;
#pragma mark Rendering
-// Renders the visual representation of this element in the specified graphics context.
+/// Renders the visual representation of this element in the specified graphics context.
+///
+/// - Parameters:
+/// - point: The origin as a <doc://com.apple.documentation/documentation/corefoundation/cgpoint>.
+/// - context: The graphics context to draw into.
- (void)drawAtPoint:(CGPoint)point inContext:(CGContextRef)context;
#pragma mark Text attachments
-// Returns NSTextAttachmentViewProvider associated with the receiver. The property contents are only valid with NSTextLayoutFragmentStateLayoutAvailable.
+/// The attachment view providers associated with the text layout fragment.
+///
+/// The property contents are only valid with
+/// `NSTextLayoutFragmentStateLayoutAvailable`.
@property (copy, readonly) NSArray<NSTextAttachmentViewProvider *> *textAttachmentViewProviders;
-// Returns the frame in the text layout fragment coordinate system for the attachment at location. It returns CGRectZero if location is not with any attachment or the state is not NSTextLayoutFragmentStateLayoutAvailable.
+/// Returns the frame in the text layout fragment coordinate system for the attachment at the location you specify.
+///
+/// Returns
+/// <doc://com.apple.documentation/documentation/coregraphics/cgrectzero> if
+/// `location` is not within any attachment or the state is not
+/// `NSTextLayoutFragmentStateLayoutAvailable`.
+///
+/// - Parameters:
+/// - location: The document location of the attachment.
+///
+/// - Returns: The frame of the attachment, or `CGRectZero`.
- (CGRect)frameForTextAttachmentAtLocation:(id <NSTextLocation>)location;
@end
NS_HEADER_AUDIT_END(nullability, sendability)
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLayoutManager.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLayoutManager.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLayoutManager.h 2026-05-29 23:13:18
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLayoutManager.h 2026-06-18 00:46:30
@@ -9,6 +9,7 @@
#import <Foundation/NSAttributedString.h>
#import <CoreGraphics/CGGeometry.h>
+#import <UIKit/UIKitDefines.h>
#import <UIKit/NSTextLayoutFragment.h>
@class NSTextRange;
@@ -26,38 +27,75 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
+/// Values that describe the rendering of selection boundaries.
typedef NS_ENUM(NSInteger, NSTextLayoutManagerSegmentType) {
- NSTextLayoutManagerSegmentTypeStandard = 0, // The standard segment matching the typographic bounds of range.
- NSTextLayoutManagerSegmentTypeSelection = 1, // The segment behavior suitable for the selection rendering. Extends the last segment in a line fragment to the trailing edge if continuing to the next line.
- NSTextLayoutManagerSegmentTypeHighlight = 2, // The segment behavior suitable for highlighting.
+ /// The standard segment, matching the typographic bounds of the range.
+ NSTextLayoutManagerSegmentTypeStandard = 0,
+ /// The segment behavior suitable for selection rendering.
+ ///
+ /// This segment type extends the last segment in a line fragment to the trailing edge if continuing to the next line.
+ NSTextLayoutManagerSegmentTypeSelection = 1,
+ /// The segment behavior suitable for highlighting.
+ NSTextLayoutManagerSegmentTypeHighlight = 2,
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
+/// Values that describe where and how the framework extends segments of a selection.
typedef NS_OPTIONS(NSUInteger, NSTextLayoutManagerSegmentOptions) {
+ /// The value that represents the empty options set.
NSTextLayoutManagerSegmentOptionsNone = 0,
- NSTextLayoutManagerSegmentOptionsRangeNotRequired = (1 << 0), // Does not allocate and pass to the enumerator
- NSTextLayoutManagerSegmentOptionsMiddleFragmentsExcluded = (1 << 1), // Only enumerates segments in the first and last line fragments.
- NSTextLayoutManagerSegmentOptionsHeadSegmentExtended = (1 << 2), // When specified, the segment is extended to the head edge
- NSTextLayoutManagerSegmentOptionsTailSegmentExtended = (1 << 3), // When specified, the segment is extended to the tail edge.
- NSTextLayoutManagerSegmentOptionsUpstreamAffinity = (1 << 4), // When specified, the segment is placed based on the upstream affinity for an empty range.
+ /// Causes the framework to enumerate text segment rectangles, but avoids preparing a range object.
+ NSTextLayoutManagerSegmentOptionsRangeNotRequired = (1 << 0),
+ /// Causes the framework to enumerate segments only in the first and last line fragments.
+ NSTextLayoutManagerSegmentOptionsMiddleFragmentsExcluded = (1 << 1),
+ /// Causes the framework to extend the segment to the head edge.
+ NSTextLayoutManagerSegmentOptionsHeadSegmentExtended = (1 << 2),
+ /// Causes the framework to extend the segment to the tail edge.
+ NSTextLayoutManagerSegmentOptionsTailSegmentExtended = (1 << 3),
+ /// Causes the framework to place the segment based on the upstream affinity for an empty range.
+ NSTextLayoutManagerSegmentOptionsUpstreamAffinity = (1 << 4),
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// NSTextLayoutManager is the center piece of the TextKit object network maintaining the layout geometry via an array of NSTextContainer and layout results with NSTextLayoutFragment associated with NSTextElement vended from the owner NSTextContentManager.
+/// The primary class that you use to manage text layout and presentation for custom text displays.
+///
+/// `NSTextLayoutManager` is the centerpiece of the TextKit object network
+/// maintaining the layout geometry through an array of ``NSTextContainer``
+/// objects. It lays out results using ``NSTextLayoutFragment`` and
+/// ``NSTextElement`` objects vended from a ``NSTextContentManager`` that
+/// participates in the content layout process.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextLayoutManager : NSObject <NSSecureCoding, NSTextSelectionDataSource>
#pragma mark Initialization
+/// Creates a new text layout manager.
- (instancetype)init NS_DESIGNATED_INITIALIZER;
+/// Creates a new text layout manager with the coder you provide.
+///
+/// - Parameters:
+/// - coder: A coder that conforms to <doc://com.apple.documentation/documentation/foundation/nscoder>.
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
#pragma mark Basic properties
+/// The delegate for the text layout manager object.
@property (nullable, weak) id <NSTextLayoutManagerDelegate> delegate;
-// If YES, uses the leading as specified by the font. However, this is not appropriate for most UI text. YES by default.
+/// A Boolean value that controls whether the framework uses the leading information specified by the font when laying out text.
+///
+/// If set to `true`, uses the leading as specified by the font. However, this
+/// isn't appropriate for most UI text. The default value is `true`.
@property BOOL usesFontLeading;
-// When YES, enables internal security analysis for malicious inputs and activates defensive behaviors. By enabling this functionality, it's possible certain text such as a very long paragraph might result in unexpected layout. NO by default.
+/// A Boolean value that controls internal security analysis for malicious inputs and activates defensive behaviors.
+///
+/// By enabling this functionality, it's possible certain text such as a very
+/// long paragraph might result in unexpected layout. The default value is `false`.
@property BOOL limitsLayoutForSuspiciousContents;
-// When YES, NSTextLayoutManager will attempt to hyphenate when wrapping lines. May be overridden on a per-paragraph basis by the NSParagraphStyle's usesDefaultHyphenation. The receiver makes the best effort to decide the exact logic including the hyphenation factor based on the context. The default value is NO. Can be overridden by the preference key @"NSUsesDefaultHyphenation".
+/// A Boolean value that controls whether the text layout manager attempts to hyphenate when wrapping lines.
+///
+/// May be overridden on a per-paragraph basis by the `NSParagraphStyle`'s
+/// `usesDefaultHyphenation`. The receiver makes the best effort to decide the
+/// exact logic including the hyphenation factor based on the context. The
+/// default value is `false`. Can be overridden by the preference key
+/// `"NSUsesDefaultHyphenation"`.
@property BOOL usesHyphenation;
/// Specifies the behavior for resolving ``NSTextAlignment/natural`` to the visual alignment.
@@ -67,112 +105,295 @@
@property BOOL resolvesNaturalAlignmentWithBaseWritingDirection API_AVAILABLE(macos(26.0), ios(26.0), tvos(26.0), visionos(26.0)) API_UNAVAILABLE(watchos);
#pragma mark NSTextContentManager interface
-// Pointing to the NSTextContentManager object strongly referencing the text layout manager.
+/// Returns the text content manager associated with this text layout manager.
@property (nullable, weak, readonly) NSTextContentManager *textContentManager;
-// This method should be used in order to replace an NSTextContentManager with a new one, leaving all related objects intact. This method makes sure the NSTextLayoutManager doesn't get deallocated while migrating to the new manager.
+/// Replaces the current text content manager with a new one you provide.
+///
+/// This method should be used in order to replace an ``NSTextContentManager``
+/// with a new one, leaving all related objects intact. This method makes sure
+/// the ``NSTextLayoutManager`` doesn't get deallocated while migrating to the
+/// new manager.
+///
+/// - Parameters:
+/// - textContentManager: The new content manager.
- (void)replaceTextContentManager:(NSTextContentManager *)textContentManager;
#pragma mark NSTextContainer interface
-// The text container object providing geometric information for the layout destination. If isSimpleRectangularTextContainer=NO, NSTextLayoutManager always fill from the top instead of allowing non-contiguous layout support.
+/// The text container object that provides geometric information for the layout destination.
+///
+/// If `isSimpleRectangularTextContainer` is `false`, ``NSTextLayoutManager`` always
+/// fills from the top instead of allowing non-contiguous layout support.
@property (nullable, strong, readwrite) NSTextContainer *textContainer;
-// The usage bounds for textContainer. KVO-compliant. Views can observe this property in order to trigger a resize operation. For example, UIView/NSView should call setNeedsUpdateConstraints() when the usage bounds changes.
+/// Returns the usage bounds for the text container.
+///
+/// KVO-compliant. Views can observe this property in order to trigger a resize
+/// operation. For example, `UIView`/`NSView` should call
+/// `setNeedsUpdateConstraints()` when the usage bounds changes.
@property (readonly) CGRect usageBoundsForTextContainer;
#pragma mark Layout
-// Returns NSTextViewportLayoutController associated with textContainer.
+/// Returns the text viewport layout controller associated with the text layout manager's text container.
@property (readonly, strong) NSTextViewportLayoutController *textViewportLayoutController;
-// If non-nil, it performs layout in the specified queue until estimatedUsageBounds=NO.
+/// The queue that the framework dispatches layout operations on.
+///
+/// If non-nil, it performs layout in the specified queue until
+/// `estimatedUsageBounds` is `false`.
@property (nullable, strong) NSOperationQueue *layoutQueue;
-// Performs the layout for textRange.
+/// Performs the layout for the specified text range.
+///
+/// - Parameters:
+/// - range: The text range to lay out.
- (void)ensureLayoutForRange:(NSTextRange *)range;
-// Performs the layout for filling bounds inside the last text container.
+/// Performs the layout for filling bounds inside the last text container.
+///
+/// - Parameters:
+/// - bounds: A <doc://com.apple.documentation/documentation/corefoundation/cgrect> that describes the layout bounds.
- (void)ensureLayoutForBounds:(CGRect)bounds;
-// Invalidates layout information for textRange
+/// Invalidates layout information for the specified text range.
+///
+/// - Parameters:
+/// - range: The text range to invalidate.
- (void)invalidateLayoutForRange:(NSTextRange *)range;
-// Returns the text layout fragment containing position inside the coordinate system for textContainer.
+/// Returns the text layout fragment at the position you specify in the text container.
+///
+/// - Parameters:
+/// - position: A <doc://com.apple.documentation/documentation/corefoundation/cgpoint> in the text container coordinate system.
+///
+/// - Returns: The layout fragment containing the position, or `nil`.
- (nullable NSTextLayoutFragment *)textLayoutFragmentForPosition:(CGPoint)position;
-// Returns the text layout fragment containing the document location, location.
+/// Returns the text layout fragment from the document at the specified location.
+///
+/// - Parameters:
+/// - location: A document location.
+///
+/// - Returns: The layout fragment containing the location, or `nil`.
- (nullable NSTextLayoutFragment *)textLayoutFragmentForLocation:(id <NSTextLocation>)location;
-// Enumerates the text layout fragments starting at textLocation. If textLocation=nil, it assumes self.textContentManager.documentRange.location; uses self.documentRange.endLocation for reverse enumeration. When enumerating backward, it starts with the fragment preceding the one containing textLocation. If enumerated at least one fragment, it returns the edge of the enumerated range. Note that the enumerated range might not match the range of the last element returned. It enumerates the elements in the sequence, but it can skip a range (it can limit the maximum number of text elements enumerated for a single invocation or hide some elements from the layout). Returning NO from block breaks out of the enumeration.
+/// Enumerates the text layout fragments starting at the specified location.
+///
+/// If `location` is `nil`, it assumes `self.textContentManager.documentRange.location`;
+/// uses `documentRange.endLocation` for reverse enumeration. When enumerating
+/// backward, it starts with the fragment preceding the one containing
+/// `location`. If enumerated at least one fragment, it returns the edge of the
+/// enumerated range. Note that the enumerated range might not match the range of
+/// the last element returned. Returning `false` from block breaks out of the
+/// enumeration.
+///
+/// - Parameters:
+/// - location: The starting location, or `nil` for the document edge.
+/// - options: Enumeration options controlling direction and behavior.
+/// - block: A block called for each layout fragment. Return `false` to stop.
+///
+/// - Returns: The edge of the enumerated range, or `nil`.
- (nullable id <NSTextLocation>)enumerateTextLayoutFragmentsFromLocation:(nullable id <NSTextLocation>)location options:(NSTextLayoutFragmentEnumerationOptions)options usingBlock:(BOOL (NS_NOESCAPE ^)(NSTextLayoutFragment *layoutFragment))block;
#pragma mark Text Selection
-// An array of NSTextSelections associated by the text layout manager. Each NSTextSelection represents an insertion point. The selection state is shared among all view ports connected to the text layout manager via text containers.
+/// An array of text selections associated by the text layout manager.
+///
+/// Each ``NSTextSelection`` represents an insertion point. The selection state is
+/// shared among all view ports connected to the text layout manager via text
+/// containers.
@property (strong) NSArray<NSTextSelection *> *textSelections;
-// Returns an NSTextSelectionNavigation configured to have the text layout manager as NSTextSelectionDataSource
+/// Returns a text selection navigation configured to have the text layout manager as its data source.
@property (strong) NSTextSelectionNavigation *textSelectionNavigation;
#pragma mark Rendering Attributes
-// Rendering attributes overrides the document text attributes stored in NSTextParagraphs supplied by NSTextContentManager. NSTextLayoutFragment associated with a text paragraph applies the overriding attributes before executing layout. Specifying NSNull to an attribute indicates removing it from the document attributes. Rendering attributes are invalidated upon re-layout of the text layout fragment that they belong to.
-
-// Enumerates the rendering attributes from location. It enumerates only ranges with rendering attributes specified. Returning NO from block breaks out of the enumeration.
+/// Enumerates the rendering attributes from the specified location.
+///
+/// It enumerates only ranges with rendering attributes specified. Returning `false`
+/// from block breaks out of the enumeration.
+///
+/// Rendering attributes override the document text attributes stored in
+/// ``NSTextParagraph`` objects supplied by ``NSTextContentManager``.
+/// ``NSTextLayoutFragment`` associated with a text paragraph applies the
+/// overriding attributes before executing layout. Specifying
+/// <doc://com.apple.documentation/documentation/foundation/nsnull> to an
+/// attribute indicates removing it from the document attributes. Rendering
+/// attributes are invalidated upon re-layout of the text layout fragment that
+/// they belong to.
+///
+/// - Parameters:
+/// - location: The starting location.
+/// - reverse: Whether to enumerate in reverse.
+/// - block: A block called for each range with rendering attributes. Return `false` to stop.
- (void)enumerateRenderingAttributesFromLocation:(id <NSTextLocation> )location reverse:(BOOL)reverse usingBlock:(BOOL (NS_NOESCAPE ^)(NSTextLayoutManager *textLayoutManager, NSDictionary<NSAttributedStringKey, id> *attributes, NSTextRange *textRange))block;
-// Sets the rendering attributes.
+/// Sets the rendering attributes for the range you specify.
+///
+/// - Parameters:
+/// - renderingAttributes: The attributes to set.
+/// - textRange: The range to apply attributes to.
- (void)setRenderingAttributes:(NSDictionary<NSAttributedStringKey, id> *)renderingAttributes forTextRange:(NSTextRange *)textRange;
-// Sets the rendering attribute. Passing nil value indicates overriding the specified attribute by removing from the final attributes passed to the layout and rendering engine. This is a convenience over -setRenderingAttributes:forTextRange:.
+/// Adds a rendering attribute for the range you specify.
+///
+/// Passing `nil` for value indicates overriding the specified attribute by
+/// removing it from the final attributes passed to the layout and rendering
+/// engine. This is a convenience over ``setRenderingAttributes:forTextRange:``.
+///
+/// - Parameters:
+/// - renderingAttribute: The <doc://com.apple.documentation/documentation/foundation/nsattributedstring/key> attribute to add.
+/// - value: The attribute value, or `nil` to remove.
+/// - textRange: The range to apply the attribute to.
- (void)addRenderingAttribute:(NSAttributedStringKey)renderingAttribute value:(nullable id)value forTextRange:(NSTextRange *)textRange;
-// Removes attribute from textRange. This is a convenience over -setRenderingAttributes:forTextRange:.
+/// Removes the rendering attribute from the specified text range.
+///
+/// This is a convenience over ``setRenderingAttributes:forTextRange:``.
+///
+/// - Parameters:
+/// - renderingAttribute: The <doc://com.apple.documentation/documentation/foundation/nsattributedstring/key> attribute to remove.
+/// - textRange: The range to remove the attribute from.
- (void)removeRenderingAttribute:(NSAttributedStringKey)renderingAttribute forTextRange:(NSTextRange *)textRange;
-// Invalidates the rendering attributes in textRange. Enumerating rendering attributes will skip the invalidated range.
+/// Invalidates the rendering attributes in the specified text range.
+///
+/// Enumerating rendering attributes will skip the invalidated range.
+///
+/// - Parameters:
+/// - textRange: The range to invalidate.
- (void)invalidateRenderingAttributesForTextRange:(NSTextRange *)textRange;
-// A callback block invoked whenever NSTextLayoutManager needs to validate the rendering attributes for the range. The validator should use -setRenderingAttributes:forTextRange: to fill the rendering attributes appropriate for the range inside textLayoutFragment.
+/// A callback block that the framework invokes whenever the text layout manager needs to validate the rendering attributes for the range.
+///
+/// The validator should use ``setRenderingAttributes:forTextRange:`` to fill the
+/// rendering attributes appropriate for the range inside `textLayoutFragment`.
@property (nullable, copy) void (^renderingAttributesValidator)(NSTextLayoutManager *textLayoutManager, NSTextLayoutFragment *textLayoutFragment);
#pragma mark Link Attributes
-// The default set of attributes for rendering NSLinkAttributeName. The base NSTextLayoutManager class returns with NSUnderlineStyleSingle for NSUnderlineStyleAttributeName and the platform link color for NSForegroundColorAttributeName. The platform color for macOS is +linkColor. Other platforms uses +blueColor.
+/// Returns the default set of attributes for rendering `NSLinkAttributeName`.
+///
+/// The base ``NSTextLayoutManager`` class returns with
+/// ``NSUnderlineStyle/single`` for
+/// <doc://com.apple.documentation/documentation/foundation/nsattributedstring/key/1524865-underlinestyle>
+/// in Swift or ``NSUnderlineStyleAttributeName`` in Objective-C, and the
+/// platform link color for
+/// <doc://com.apple.documentation/documentation/foundation/nsattributedstring/key/1533563-foregroundcolor>
+/// in Swift or ``NSForegroundColorAttributeName`` in Objective-C. The platform
+/// color for macOS is `linkColor`. Other platforms use `blueColor`.
@property (class, readonly) NSDictionary<NSAttributedStringKey, id> *linkRenderingAttributes;
-// Returns a dictionary of rendering attributes for rendering NSLinkAttributeName. Just as other rendering attributes, specifying NSNull removes the attribute from the final attributes used for rendering. It has priority over the general rendering attributes.
+
+/// Returns a dictionary of rendering attributes for rendering a link.
+///
+/// Just as other rendering attributes, specifying
+/// <doc://com.apple.documentation/documentation/foundation/nsnull> removes the
+/// attribute from the final attributes used for rendering. It has priority over
+/// the general rendering attributes.
+///
+/// - Parameters:
+/// - link: The link object.
+/// - location: The document location of the link.
+///
+/// - Returns: A dictionary of rendering attributes.
- (NSDictionary<NSAttributedStringKey, id> *)renderingAttributesForLink:(id)link atLocation:(id <NSTextLocation>)location;
#pragma mark Text Segments
-// Enumerates text segments of type in textRange. A text segment is both logically and visually contiguous portion of the text content inside a line fragment. It can be defined with a single text range. The segments are enumerated visually from left to right. Returning NO from block breaks out of the enumeration.
+/// Enumerates text segments of a specific type and in the text range you provide.
+///
+/// A text segment is both logically and visually contiguous portion of the text
+/// content inside a line fragment. It can be defined with a single text range.
+/// The segments are enumerated visually from left to right. Returning `false` from
+/// block breaks out of the enumeration.
+///
+/// - Parameters:
+/// - textRange: The range to enumerate segments in.
+/// - type: The segment type.
+/// - options: Options controlling segment behavior.
+/// - block: A block called for each segment. Return `false` to stop.
- (void)enumerateTextSegmentsInRange:(NSTextRange *)textRange type:(NSTextLayoutManagerSegmentType)type options:(NSTextLayoutManagerSegmentOptions)options usingBlock:(BOOL (NS_NOESCAPE ^)(NSTextRange * _Nullable textSegmentRange, CGRect textSegmentFrame, CGFloat baselinePosition, NSTextContainer *textContainer))block;
#pragma mark Editing
+/// Replaces content at the location you specify with the text elements you provide.
+///
+/// - Parameters:
+/// - range: The range of the content to replace.
+/// - textElements: An array of text elements.
- (void)replaceContentsInRange:(NSTextRange *)range withTextElements:(NSArray<NSTextElement *> *)textElements;
+/// Replaces content at the location you specify with an attributed string you provide.
+///
+/// - Parameters:
+/// - range: The range of the content to replace.
+/// - attributedString: An attributed string to replace the content at `range`.
- (void)replaceContentsInRange:(NSTextRange *)range withAttributedString:(NSAttributedString *)attributedString;
@end
#pragma mark NSTextLayoutManagerDelegate
+/// Optional methods that delegates implement to respond to layout changes.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@protocol NSTextLayoutManagerDelegate <NSObject>
@optional
-// NSTextLayoutFragment management
-// Returns NSTextLayoutFragment for location in textElement. NSTextLayoutManagerDelegate could provide an NSTextLayoutFragment specialized for an NSTextElement subclass targeted for the rendering surface.
+/// Returns a text layout fragment for the specified location in the text element.
+///
+/// The delegate can provide an ``NSTextLayoutFragment`` specialized for an
+/// ``NSTextElement`` subclass targeted for the rendering surface.
+///
+/// - Parameters:
+/// - textLayoutManager: The text layout manager sending the message.
+/// - location: The document location.
+/// - textElement: The text element containing the location.
+///
+/// - Returns: A layout fragment for the location, or `nil` to use the default.
- (NSTextLayoutFragment *)textLayoutManager:(NSTextLayoutManager *)textLayoutManager textLayoutFragmentForLocation:(id <NSTextLocation>)location inTextElement:(NSTextElement *)textElement;
-// Layout behavior
-// Invoked while determining the soft line break point. When hyphenating=NO, NSTextLayoutManager tries to find the next line break opportunity before location. When hyphenating=YES, it is an auto-hyphenation point.
+/// Invoked while determining the soft line break point.
+///
+/// When `hyphenating` is `false`, ``NSTextLayoutManager`` tries to find the next
+/// line break opportunity before location. When `hyphenating` is `true`, it is an
+/// auto-hyphenation point.
+///
+/// - Parameters:
+/// - textLayoutManager: The text layout manager sending the message.
+/// - location: The candidate break location.
+/// - hyphenating: `true` if this is an auto-hyphenation point.
+///
+/// - Returns: `true` to allow the break; `false` to prevent it.
- (BOOL)textLayoutManager:(NSTextLayoutManager *)textLayoutManager shouldBreakLineBeforeLocation:(id <NSTextLocation>)location hyphenating:(BOOL)hyphenating;
-// Rendering attributes
-// Returns a dictionary of rendering attributes for rendering NSLinkAttributeName. Just as other rendering attributes, specifying NSNull removes the attribute from the final attributes used for rendering. It has priority over the general rendering attributes.
+/// Returns a dictionary of rendering attributes for rendering a link.
+///
+/// Just as other rendering attributes, specifying
+/// <doc://com.apple.documentation/documentation/foundation/nsnull> removes the
+/// attribute from the final attributes used for rendering. It has priority over
+/// the general rendering attributes.
+///
+/// - Parameters:
+/// - textLayoutManager: The text layout manager sending the message.
+/// - link: The link object.
+/// - location: The document location of the link.
+/// - renderingAttributes: The default rendering attributes.
+///
+/// - Returns: A dictionary of rendering attributes for the link, or `nil` to use defaults.
- (nullable NSDictionary<NSAttributedStringKey, id> *)textLayoutManager:(NSTextLayoutManager *)textLayoutManager renderingAttributesForLink:(id)link atLocation:(id <NSTextLocation>)location defaultAttributes:(NSDictionary<NSAttributedStringKey, id> *)renderingAttributes;
-// Returns the text viewport layout container for textContainer. If this method returns nil, it will instantiate from NSTextViewportLayoutController.
-- (nullable NSTextViewportLayoutController *)textLayoutManager:(NSTextLayoutManager *)textLayoutManager textViewportLayoutControllerForTextContainer:(NSTextContainer *)textContainer API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// View Provider caching
-// When implemented, notifies delegate that the viewProvider associated with a particular textAttachment is about to be invalidated, and can be used to cache the viewProvider.
+
+/// Notifies the delegate that a view provider associated with a text attachment is about to be invalidated.
+///
+/// The delegate can use this to cache the view provider.
+///
+/// - Parameters:
+/// - textLayoutManager: The text layout manager sending the message.
+/// - viewProvider: The view provider being invalidated.
+/// - textAttachment: The attachment associated with the view provider.
- (void)textLayoutManager:(NSTextLayoutManager *)textLayoutManager cacheTextAttachmentViewProvider:(NSTextAttachmentViewProvider *)viewProvider forTextAttachment:(NSTextAttachment *)textAttachment API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), visionos(27.0)) API_UNAVAILABLE(watchos);
-// Returns a cached NSTextAttachmentViewProvider to be associated with a particular attachment
+/// Returns a cached `NSTextAttachmentViewProvider` to be associated with a particular attachment.
+///
+/// - Parameters:
+/// - textLayoutManager: The text layout manager sending the message.
+/// - attachment: The attachment to retrieve a cached view provider for.
+///
+/// - Returns: A previously cached view provider, or `nil`.
- (nullable NSTextAttachmentViewProvider *)textLayoutManager:(NSTextLayoutManager *)textLayoutManager retrieveCachedTextAttachmentViewProviderForTextAttachment:(NSTextAttachment *)attachment API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), visionos(27.0)) API_UNAVAILABLE(watchos);
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLineFragment.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLineFragment.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLineFragment.h 2026-05-30 22:15:06
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextLineFragment.h 2026-06-18 00:46:31
@@ -13,41 +13,84 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
#pragma mark NSTextLineFragment
-// NSTextLineFragment represents a single textual layout and rendering unit inside NSTextLayoutFragment.
+/// A class that represents a line fragment as a single textual layout and rendering unit inside a text layout fragment.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextLineFragment : NSObject <NSSecureCoding>
#pragma mark Initialization
+/// Creates a new line fragment with the attributed string and range you provide.
+///
+/// - Parameters:
+/// - attributedString: The source attributed string.
+/// - range: An <doc://com.apple.documentation/documentation/foundation/nsrange> that specifies which characters to include.
- (instancetype)initWithAttributedString:(NSAttributedString *)attributedString range:(NSRange)range NS_DESIGNATED_INITIALIZER;
+/// Creates a new line fragment from the coder you provide.
+///
+/// - Parameters:
+/// - aDecoder: A coder that conforms to <doc://com.apple.documentation/documentation/foundation/nscoder>.
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;
+/// Creates a new line fragment with the string, attributes, and range you provide.
- (instancetype)initWithString:(NSString *)string attributes:(NSDictionary<NSAttributedStringKey, id> *)attributes range:(NSRange)range;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark Basic properties
-// The source attributed string
+/// The source attributed string.
@property (strong, readonly) NSAttributedString *attributedString;
-// The string range for the source attributed string corresponding to this line fragment
+/// The string range for the source attributed string corresponding to this line fragment.
@property (readonly) NSRange characterRange;
#pragma mark Typographic bounds
-// The typographic bounds specifying the dimensions of the line fragment for laying out line fragments to each other. The origin value is offset from the beginning of the line fragment group belonging to the parent layout fragment.
+/// The typographic bounds specifying the dimensions of the line fragment for laying out line fragments to each other.
+///
+/// The origin value is offset from the beginning of the line fragment group
+/// belonging to the parent layout fragment.
@property (readonly) CGRect typographicBounds;
#pragma mark Rendering
-// Rendering origin for the left most glyph in the line fragment coordinate system
+/// The rendering origin for the leftmost glyph in the line fragment coordinate system.
@property (readonly) CGPoint glyphOrigin;
-// Renders the line fragment contents at the rendering origin. The origin can be specified as (CGRectGetMinX(typographicBounds), CGRectGetMinY(typographicBounds)) relative to the parent layout fragment coordinate system.
+/// Renders the line fragment contents at the specified point.
+///
+/// The origin can be specified as
+/// `(CGRectGetMinX(typographicBounds), CGRectGetMinY(typographicBounds))`
+/// relative to the parent layout fragment coordinate system.
+///
+/// - Parameters:
+/// - point: The origin as a <doc://com.apple.documentation/documentation/corefoundation/cgpoint>.
+/// - context: The graphics context to draw into.
- (void)drawAtPoint:(CGPoint)point inContext:(CGContextRef)context;
#pragma mark Character and point mappings
-// The location of the character at the specified index. It is on the upstream edge of the glyph. It is in the coordinate system relative to the line fragment origin
+/// Returns the location of the character at the specified index.
+///
+/// The location is on the upstream edge of the glyph, in the coordinate system
+/// relative to the line fragment origin.
+///
+/// - Parameters:
+/// - index: The character index within this line fragment.
+///
+/// - Returns: A <doc://com.apple.documentation/documentation/corefoundation/cgpoint> on the upstream edge of the glyph, in the coordinate system relative to the line fragment origin.
- (CGPoint)locationForCharacterAtIndex:(NSInteger)index;
-// The character index for point inside the line fragment coordinate system. The fraction of distance is from the upstream edge
+/// Returns the character index for the point inside the line fragment coordinate system.
+///
+/// - Parameters:
+/// - point: A <doc://com.apple.documentation/documentation/corefoundation/cgpoint> in the line fragment coordinate system.
+///
+/// - Returns: The character index nearest to the point.
- (NSInteger)characterIndexForPoint:(CGPoint)point;
+
+/// Returns the fraction of the distance through the glyph for the point.
+///
+/// The fraction of distance is from the upstream edge.
+///
+/// - Parameters:
+/// - point: A <doc://com.apple.documentation/documentation/corefoundation/cgpoint> in the line fragment coordinate system.
+///
+/// - Returns: A value between 0.0 and 1.0 indicating the fraction through the glyph.
- (CGFloat)fractionOfDistanceThroughGlyphForPoint:(CGPoint)point;
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextList.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextList.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextList.h 2026-06-01 00:34:57
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextList.h 2026-06-18 00:23:34
@@ -9,58 +9,182 @@
#import <UIKit/UIKitDefines.h>
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
-// NSTextList represents a stylistic format of a group of text list items belonging to the same nested level. It supports both ordered and unordered lists. The type of marker is defined by markerFormat.
+/// A section of text that forms a single list.
+///
+/// `NSTextList` represents a stylistic format of a group of text list items
+/// belonging to the same nested level. It supports both ordered and unordered
+/// lists. The type of marker is defined by ``markerFormat``.
+/// Values for available options for text list items.
typedef NS_OPTIONS(NSUInteger, NSTextListOptions) {
- NSTextListPrependEnclosingMarker API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0)) = (1 << 0), // All marker strings up to the top-level parent are concatenated to the marker string used by the text list item.
+ /// Specifies that a nested list should include the marker for its enclosing superlist before its own marker.
+ NSTextListPrependEnclosingMarker API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0)) = (1 << 0),
} API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
typedef NSString * NSTextListMarkerFormat NS_TYPED_EXTENSIBLE_ENUM API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a square-shaped marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerBox API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a checkmark-shaped marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerCheck API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a circle-shaped marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerCircle API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a diamond-shaped marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerDiamond API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a disc-shaped marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerDisc API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a hyphen-shaped marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerHyphen API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a square-shaped marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerSquare API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a lowercase hexadecimal (base 16) numerical marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerLowercaseHexadecimal API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents an uppercase hexadecimal (base 16) numerical marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerUppercaseHexadecimal API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents an octal (base 8) numerical marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerOctal API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a lowercase localized alphabetical marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerLowercaseAlpha API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents an uppercase localized alphabetical marker that you can apply to a text list item.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerUppercaseAlpha API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a lowercase Latin alphabetical marker that you can apply to a text list item.
+///
+/// Lowercase Latin alphabetical markers follow the pattern a, b, c, and so on.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerLowercaseLatin API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents an uppercase Latin alphabetical marker that you can apply to a text list item.
+///
+/// Uppercase Latin alphabetical markers follow the pattern A, B, C, and so on.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerUppercaseLatin API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a lowercase Roman numeral marker that you can apply to a text list item.
+///
+/// Lowercase Roman numeral markers follow the pattern i, ii, iii, iv, and so on.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerLowercaseRoman API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents an uppercase Roman numeral marker that you can apply to a text list item.
+///
+/// Uppercase Roman numeral markers follow the pattern I, II, III, IV, and so on.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerUppercaseRoman API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// The value that represents a decimal annotation marker that you can apply to a text list item.
+///
+/// Decimal annotation markers follow the pattern 1.0, 1.1, 2.0, and so on.
UIKIT_EXTERN NSTextListMarkerFormat const NSTextListMarkerDecimal API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0));
+/// A section of text that forms a single list.
+///
+/// The visible elements of the list, including list markers, appear in the text
+/// as they do for lists created by hand. The list object, however, allows the
+/// list to be recognized as such by the text system. This enables automatic
+/// creation of markers and spacing. Text lists are used in HTML import and
+/// export.
+///
+/// Text lists appear as attributes on paragraphs, as part of the paragraph
+/// style. An ``NSParagraphStyle`` may have an array of text lists, representing
+/// the nested lists containing the paragraph, in order from outermost to
+/// innermost. For example, if list1 contains four paragraphs, the middle two of
+/// which are also in the inner list2, then the text lists array for the first
+/// and fourth paragraphs is (list1), while the text lists array for the second
+/// and third paragraphs is (list1, list2).
+///
+/// The methods implementing this are ``NSParagraphStyle/textLists`` on
+/// ``NSParagraphStyle``, and ``NSMutableParagraphStyle/textLists`` on
+/// ``NSMutableParagraphStyle``.
+///
+/// In addition,
+/// <doc://com.apple.documentation/documentation/foundation/nsattributedstring>
+/// has convenience methods for lists, such as
+/// <doc://com.apple.documentation/documentation/foundation/nsattributedstring/1525314-range>,
+/// which determines the range covered by a list, and
+/// <doc://com.apple.documentation/documentation/foundation/nsattributedstring/1527303-itemnumber>,
+/// which determines the ordinal position within a list of a particular item.
API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), watchos(2.0), visionos(1.0))
@interface NSTextList : NSObject <NSSecureCoding, NSCopying>
#pragma mark Initialization
+/// Returns a new text list with the format, options, and starting item number you provide.
+///
+/// - Parameters:
+/// - markerFormat: One of the possible ``NSTextList/MarkerFormat`` formats.
+/// - options: One or more of the possible ``NSTextList/Options`` options.
+/// - startingItemNumber: An integer that represents the starting item number.
- (instancetype)initWithMarkerFormat:(NSTextListMarkerFormat)markerFormat options:(NSTextListOptions)options startingItemNumber:(NSInteger)startingItemNumber NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), watchos(9.0), visionos(1.0));
+
+/// Returns an initialized text list.
+///
+/// The marker format is specified as a constant string, except for a numbering
+/// specifier, which takes the form `{`keyword`}`. The currently supported
+/// values for keyword include:
+///
+/// - `box`
+/// - `check`
+/// - `circle`
+/// - `diamond`
+/// - `disc`
+/// - `hyphen`
+/// - `square`
+/// - `lower-hexadecimal`
+/// - `upper-hexadecimal`
+/// - `octal`
+/// - `lower-alpha` or `lower-latin`
+/// - `upper-alpha` or `upper-latin`
+/// - `lower-roman`
+/// - `upper-roman`
+/// - `decimal`
+///
+/// Thus, for example, `@"({decimal})"` would specify the format for a list
+/// numbered (1), (2), (3), and so on, and `@"{upper-roman}"` would specify the
+/// format for a list numbered I, II, III, IV, and so on. (All of these keywords
+/// are included in the Cascading Style Sheets level 3 specification.)
+///
+/// - Parameters:
+/// - markerFormat: The marker format for the text list.
+/// - options: The marker options for the text list.
+///
+/// - Returns: An initialized text list.
+///
+/// ## See Also
+///
+/// - ``markerFormat``
+/// - ``listOptions``
- (instancetype)initWithMarkerFormat:(NSTextListMarkerFormat)markerFormat options:(NSUInteger)options;
+/// Initializes and returns a newly allocated text list item.
+///
+/// - Parameters:
+/// - coder: An instance of <doc://com.apple.documentation/documentation/foundation/nscoder>.
- (nullable instancetype) initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
#pragma mark Properties
+/// The marker format string used by the receiver.
+///
+/// ## See Also
+///
+/// - ``NSTextList/init(markerFormat:options:)``
@property (readonly, strong) NSTextListMarkerFormat markerFormat;
+
+/// The list options mask value of the receiver.
@property (readonly) NSTextListOptions listOptions;
#pragma mark Ordered List
-// When > 0, it is used to define the starting value for a group of ordered text list.
+/// The starting item number for the text list.
+///
+/// The default value is `1`. This value will be used only for ordered lists,
+/// and ignored in other cases.
@property NSInteger startingItemNumber;
-// Yes if markerFormat is an ordered text list type
+/// A Boolean value that indicates whether the list is ordered.
@property (readonly, getter=isOrdered) BOOL ordered API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), watchos(9.0), visionos(1.0));
#pragma mark Resolved Marker String
-// Returns the marker corresponding to itemNumber. itemNumber is ignored if < 1 or isOrdered==NO.
+/// Returns the computed value for a specific ordinal position in the list.
+///
+/// - Parameters:
+/// - itemNumber: The ordinal position in the list whose computed marker value is desired. The receiver ignores this parameter if `itemNumber` is less than 1 or ``isOrdered`` is `false`.
+///
+/// - Returns: The computed marker value for `itemNumber`.
- (NSString *)markerForItemNumber:(NSInteger)itemNumber;
#pragma mark Marker handling
-// When YES, TextKit includes text list marker in the contents.
-// It is NO by default.
+/// A Boolean value that indicates whether TextKit includes text list markers in the contents.
+///
+/// The default value is `false`.
@property (readonly, class) BOOL includesTextListMarkers API_AVAILABLE(macos(26.0), ios(26.0), tvos(26.0), watchos(26.0), visionos(26.0));
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextListElement.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextListElement.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextListElement.h 2026-05-30 22:15:06
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextListElement.h 2026-06-18 01:46:14
@@ -13,38 +13,77 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
-// NSTextListElement is a concrete subclass of NSTextElement representing a text list node. It can contain an array of child element. A text list can be represented by a tree of NSTextListElements.
+/// A class that represents a text list node.
+///
+/// It can contain an array of child elements. A text list can be represented by
+/// a tree of `NSTextListElement` objects.
#pragma mark NSTextListElement
API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextListElement : NSTextParagraph
#pragma mark Initializer
-// Designated initializer. Initializes 2 types of NSTextListElement: a standard list item and nesting parent element. Either of contents, markerAttributes, or childElements must be non-nil. Clients should typically use one of 2 factory methods below for instantiating with a specific type. When markerAttributes!=nil, it will be used to format the marker; otherwise, it is derived from contents.
+/// Creates a text list element with the parent, list elements, nesting level, and marker attributes you provide.
+///
+/// - Parameters:
+/// - parent: The parent `NSTextListElement` of this element, if any.
+/// - textList: The ``NSTextList`` to add elements to.
+/// - contents: An <doc://com.apple.documentation/documentation/foundation/nsattributedstring> that contains the contents of the text list element.
+/// - markerAttributes: A dictionary of <doc://com.apple.documentation/documentation/foundation/nsattributedstring/key> keys and values that describe the marker attributes.
+/// - children: An array of ``NSTextListElement`` elements.
+///
+/// One of `contents`, `markerAttributes`, or `childElements` must be non-`nil`.
+/// If `markerAttributes` is not `nil` this method uses it to format the marker;
+/// otherwise it is derived from `contents`.
+///
+/// To instantiate a text list element with a specific type, use either
+/// ``textListElementWithChildElements:textList:nestingLevel:`` or
+/// ``textListElementWithContents:markerAttributes:textList:childElements:`` instead.
- (instancetype)initWithParentElement:(nullable NSTextListElement *)parent textList:(NSTextList *)textList contents:(nullable NSAttributedString *)contents markerAttributes:(nullable NSDictionary<NSAttributedStringKey, id> *)markerAttributes childElements:(nullable NSArray<NSTextListElement *> *)children NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithAttributedString:(nullable NSAttributedString *)attributedString NS_UNAVAILABLE;
-// Instantiates a standard text list.
+/// Creates a text list element with the list elements, nesting level, and marker attributes you provide.
+///
+/// - Parameters:
+/// - contents: An <doc://com.apple.documentation/documentation/foundation/nsattributedstring> that contains the contents of the text list element.
+/// - markerAttributes: A dictionary of <doc://com.apple.documentation/documentation/foundation/nsattributedstring/key> keys and values that describe the marker attributes.
+/// - textList: The ``NSTextList`` to add elements to.
+/// - children: An array of ``NSTextListElement`` elements.
+ (instancetype)textListElementWithContents:(NSAttributedString *)contents markerAttributes:(nullable NSDictionary<NSAttributedStringKey, id> *)markerAttributes textList:(NSTextList *)textList childElements:(nullable NSArray<NSTextListElement *> *)children;
-// Returns an instance with childElements without contents. Returns nil if childElements.count == 0. nestingLevel specifies the number of shifts represented by the tree elements returned. Raises an exception when nestingLevel < 0. textList specifies NSTextList used by the new instance.
+/// Creates a text list element with the list elements and nesting level you provide.
+///
+/// Raises an exception when `nestingLevel < 0`.
+///
+/// - Parameters:
+/// - children: An array of ``NSTextListElement`` elements.
+/// - textList: The ``NSTextList`` to add elements to.
+/// - nestingLevel: An integer value that describes the level of nesting of these elements.
+///
+/// - Returns: `nil` if `children.count` is zero.
+ (nullable instancetype)textListElementWithChildElements:(NSArray<NSTextListElement *> *)children textList:(NSTextList *)textList nestingLevel:(NSInteger)nestingLevel;
#pragma mark Properties
+/// The value that represents the text list.
@property (readonly, strong) NSTextList *textList;
-// Element contents
-@property (nullable, readonly, strong) NSAttributedString *contents; // The text list element contents without markers and formatting.
+/// The text list element contents without markers and formatting.
+@property (nullable, readonly, strong) NSAttributedString *contents;
-@property (nullable, readonly, strong) NSDictionary<NSAttributedStringKey, id> *markerAttributes; // Attributes defining the text formatting of marker string inside attributedString.
+/// A dictionary of attributed string keys and values that represent the list's marker attributes.
+@property (nullable, readonly, strong) NSDictionary<NSAttributedStringKey, id> *markerAttributes;
-@property (strong, readonly) NSAttributedString *attributedString; // The contents intended to be displayed. Derived from contents/textList configured with the text list element's position inside the tree. It is overriding its superclass implementation, NSTextParagraph.attributedString
+/// An attributed string that represents the string the framework displays for this element taking into account markers and the indentation level of the list element.
+///
+/// Derived from ``contents`` and ``textList`` configured with the text list
+/// element's position inside the tree. Overrides `NSTextParagraph.attributedString`.
+@property (strong, readonly) NSAttributedString *attributedString;
#pragma mark Child Elements
-// NSTextListElement has children of the same type.
+/// An array that contains child text elements.
@property (readonly, copy) NSArray<NSTextListElement *> *childElements;
-// NSTextListElement has the parent of the same type.
+/// A text list element that refers to the enclosing text list element.
@property (nullable, readonly, weak) NSTextListElement *parentElement;
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextRange.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextRange.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextRange.h 2026-05-29 23:13:18
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextRange.h 2026-06-18 00:23:34
@@ -11,17 +11,33 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
#pragma mark NSTextLocation
-// NSTextLocation represents an abstract location inside document contents. A concrete class conforming to the protocol should be associated with a particular document backing store type. The interpretation of a location in enumeration operations is depending on the logical direction. When enumerating forward, it should start with the item containing the location. The enumeration should start with an item preceding the location for reverse operations.
+/// An interface you implement that represents an abstract location inside your document's content.
+///
+/// A concrete class conforming to the protocol should be associated with a
+/// particular document backing store type. The interpretation of a location in
+/// enumeration operations depends on the logical direction. When enumerating
+/// forward, it should start with the item containing the location. The
+/// enumeration should start with an item preceding the location for reverse
+/// operations.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0), visionos(1.0)) NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
@protocol NSTextLocation <NSObject>
-// Compares and returns the logical ordering to location
+/// Compares and returns the logical ordering to location.
+///
+/// - Parameters:
+/// - location: The location to compare the current location to.
+///
+/// - Returns: A <doc://com.apple.documentation/documentation/foundation/comparisonresult>.
- (NSComparisonResult)compare:(id <NSTextLocation>)location API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0), visionos(1.0));
-// Basic comparison of location equivalence, should have the result of NSOrderedSame from compare:
+/// Returns `true` for locations representing the same document position.
+///
+/// Must not depend on auxiliary state such as affinity or visual-edge
+/// preference. Locations from different data source methods are compared using
+/// `isEqual:` and must agree when they refer to the same position.
- (BOOL)isEqual:(nullable id)location;
-// Must be consistent with results from isEqual while also avoiding hash collisions
+/// Must be consistent with results from `isEqual:` while also avoiding hash collisions.
@property (readonly) NSUInteger hash;
@end
@@ -37,12 +53,13 @@
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0), visionos(1.0))
@interface NSTextRange : NSObject
#pragma mark Initialization
-// Returns an empty range when endLocation=nil
/// Creates a new text range with the starting and ending locations you specify.
///
+/// Returns an empty range when `endLocation` is `nil`.
+///
/// - Parameters:
/// - location: The starting location.
-/// - endLocation: The ending location.
+/// - endLocation: The ending location, or `nil` for an empty range.
- (nullable instancetype)initWithLocation:(id <NSTextLocation>)location endLocation:(nullable id <NSTextLocation>)endLocation NS_DESIGNATED_INITIALIZER;
/// Creates a new text range at the location you specify.
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextSelection.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextSelection.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextSelection.h 2026-06-01 00:34:57
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextSelection.h 2026-06-18 00:23:34
@@ -14,65 +14,114 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
-// NSTextSelection represents a single logical selection context corresponding to an insertion point.
+/// A class that represents a single logical selection context that corresponds to an insertion point.
#pragma mark NSTextSelection
+/// Values that describe the different granularities available to make a selection.
typedef NS_ENUM(NSInteger, NSTextSelectionGranularity) {
+ /// A value that represents selection by character.
NSTextSelectionGranularityCharacter,
+ /// A value that represents selection by word.
NSTextSelectionGranularityWord,
+ /// A value that represents selection by paragraph.
NSTextSelectionGranularityParagraph,
+ /// A value that represents selection by line.
NSTextSelectionGranularityLine,
+ /// A value that represents selection by sentence.
NSTextSelectionGranularitySentence
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
+/// Values that describe the visual location of the text cursor, or the direction of the non-anchored edge of the selection.
typedef NS_ENUM(NSInteger, NSTextSelectionAffinity) {
+ /// The value that defines the visual location of the text cursor at the tail of the previous line.
NSTextSelectionAffinityUpstream = 0,
+ /// The value that defines the visual location of the text cursor at the head of the line containing the selection location.
NSTextSelectionAffinityDownstream = 1
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextSelection : NSObject <NSSecureCoding>
#pragma mark Initialization
-// textRanges should be ordered and not overlapping. Otherwise, textRanges would get normalized by reordered and merging overlapping ranges.
+/// Creates a new text selection with the ranges, affinity, and granularity you specify.
+///
+/// `textRanges` should be ordered and not overlapping. Otherwise, they will be
+/// normalized by reordering and merging overlapping ranges.
+///
+/// - Parameters:
+/// - textRanges: An array of text ranges for this selection.
+/// - affinity: The affinity of the selection.
+/// - granularity: The granularity of the selection.
- (instancetype)initWithRanges:(NSArray<NSTextRange *> *)textRanges affinity:(NSTextSelectionAffinity)affinity granularity:(NSTextSelectionGranularity)granularity NS_DESIGNATED_INITIALIZER;
+/// Creates a new text selection from the coder you provide.
+///
+/// - Parameters:
+/// - coder: A coder that conforms to <doc://com.apple.documentation/documentation/foundation/nscoder>.
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
+/// Creates a new text selection with the range, affinity, and granularity you specify.
- (instancetype)initWithRange:(NSTextRange *)range affinity:(NSTextSelectionAffinity)affinity granularity:(NSTextSelectionGranularity)granularity;
+/// Creates a new text selection at the specified location with the given affinity.
- (instancetype)initWithLocation:(id <NSTextLocation>)location affinity:(NSTextSelectionAffinity)affinity;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark Basic properties
-// Represents an array of disjoint logical ranges in the selection. The array must be logically ordered. When editing, all ranges in a text selection constitute a single insertion point.
+/// An array of disjoint logical ranges in the selection.
+///
+/// The array must be logically ordered. When editing, all ranges in a text
+/// selection constitute a single insertion point.
@property (copy, readonly) NSArray<NSTextRange *> *textRanges;
-// The granularity of the selection. NSTextSelectionGranularityByCharacter by default. Extending operations should modify the selection by the granularity.
+/// The granularity of the selection.
+///
+/// `NSTextSelectionGranularityCharacter` by default. Extending operations
+/// should modify the selection by the granularity.
@property (readonly) NSTextSelectionGranularity granularity;
-// Either upstream or downstream selection. NSTextSelectionAffinityDownstream by default. For a 0-length selection, it describes the visual location of the text cursor between the head of line containing the selection location (downstream) or tail of the previous line (upstream). For a selection with contents, it describes the logical direction of non-anchored edge of the selection.
+/// Either upstream or downstream selection.
+///
+/// `NSTextSelectionAffinityDownstream` by default. For a 0-length selection, it
+/// describes the visual location of the text cursor between the head of line
+/// containing the selection location (downstream) or tail of the previous line
+/// (upstream). For a selection with contents, it describes the logical direction
+/// of the non-anchored edge of the selection.
@property (readonly) NSTextSelectionAffinity affinity;
-// Transient text selection during drag handling
+/// A Boolean value indicating whether this is a transient text selection during drag handling.
@property (readonly, getter=isTransient) BOOL transient;
#pragma mark Navigation properties
-// Represents the anchor position offset from the beginning of a line fragment in the visual order for the initial tap or mouse down. That is from the left for a horizontal line fragment and from the top for a vertical. Navigating between lines uses this point when the current line fragment associated with the selection is shorter than the next line visited. 0.0 by default.
+/// The anchor position offset from the beginning of a line fragment in visual order.
+///
+/// That is, from the left for a horizontal line fragment and from the top for a
+/// vertical. Navigating between lines uses this point when the current line
+/// fragment associated with the selection is shorter than the next line visited.
+/// The default value is `0.0`.
@property CGFloat anchorPositionOffset;
#pragma mark Visual selection
-// Indicates whether the selection should be interpreted as logical or visual.
+/// A Boolean value indicating whether the selection should be interpreted as logical or visual.
@property (getter=isLogical) BOOL logical;
-// Specifies the secondary character location when user taps/clicks at a directional boundary. Setting non-nil location has a side effect of making -logical=NO.
+/// The secondary character location when the user taps or clicks at a directional boundary.
+///
+/// Setting a non-nil location has a side effect of making ``logical`` `false`.
@property (strong, nullable) id <NSTextLocation> secondarySelectionLocation;
#pragma mark Typing attributes
-// The template attributes used for characters replacing the contents of this selection.
+/// The template attributes used for characters replacing the contents of this selection.
@property (copy) NSDictionary<NSAttributedStringKey, id> *typingAttributes;
#pragma mark Selection manipulation
-// Returns a copy of this selection, replacing this instance's textRanges property with textRanges but keeping all other attributes the same.
+/// Returns a copy of this selection, replacing the text ranges with the ones you provide.
+///
+/// All other attributes remain the same.
+///
+/// - Parameters:
+/// - textRanges: The new text ranges for the returned selection.
+///
+/// - Returns: A new ``NSTextSelection`` with the updated ranges.
- (NSTextSelection *)textSelectionWithTextRanges:(NSArray<NSTextRange *> *)textRanges;
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextSelectionNavigation.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextSelectionNavigation.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextSelectionNavigation.h 2026-06-01 00:34:57
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextSelectionNavigation.h 2026-06-18 00:07:09
@@ -18,125 +18,347 @@
@protocol NSTextLocation;
@protocol NSTextSelectionDataSource;
-// NSTextSelectionNavigation is an interface exposing methods for obtaining results from actions performed on text selections. It returns the essential information necessary for editing, selecting, and navigating operations.
+/// An interface you use to expose methods for obtaining results from actions performed on text selections.
+///
+/// It returns the essential information necessary for editing, selecting, and
+/// navigating operations.
+/// Values that describe the direction of a selection.
typedef NS_ENUM(NSInteger, NSTextSelectionNavigationDirection) {
// Logical directions
// Works with just character information
+ /// The value that represents a logical forward selection based on the flow of text stored in the document.
NSTextSelectionNavigationDirectionForward,
+ /// The value that represents a logical backward selection based on the flow of text stored in the document.
NSTextSelectionNavigationDirectionBackward,
// Visual directions
// Requires layout information if the direction is along the line (i.e. right and left for a horizontal line). Otherwise, it gets resolved to the corresponding logical direction except for NSTextSelectionNavigationDestinationCharacter
+ /// The value that represents a selection in the right direction along the current line.
NSTextSelectionNavigationDirectionRight,
+ /// The value that represents a selection in the left direction along the current line.
NSTextSelectionNavigationDirectionLeft,
+ /// The value that represents a selection in the up direction, above the current line.
NSTextSelectionNavigationDirectionUp,
+ /// The value that represents a selection in the down direction, below the current line.
NSTextSelectionNavigationDirectionDown
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
+/// Values that affect how the framework handles navigation across different textual boundaries during a selection.
typedef NS_ENUM(NSInteger, NSTextSelectionNavigationDestination) {
- NSTextSelectionNavigationDestinationCharacter, // Moving to the next extended grapheme cluster boundary. Could result in a location inside a cluster depending on operations. When the movement direction is not along the line (i.e. up and down for a horizontal line), it moves to the adjacent line using the anchor point instead of resolving to the logical direction
- NSTextSelectionNavigationDestinationWord, // Moving to the next word boundary. Ignores punctuations, whitespaces, and format characters preceding the next word
- NSTextSelectionNavigationDestinationLine, // Moving to the next line boundary. The boundary can be logical based on the line separator characters as well as visual with soft line wrapping
- NSTextSelectionNavigationDestinationSentence, // Moving to the next sentence boundary. Ignores punctuations, whitespaces, and format characters preceding the next sentence
- NSTextSelectionNavigationDestinationParagraph, // Moving to the next paragraph boundary. Ignores the end of line elastic characters and paragraph separators
- NSTextSelectionNavigationDestinationContainer, // Moving to the next container/page boundary. Ignores the end of line elastic characters and container/page separators
- NSTextSelectionNavigationDestinationDocument, // Moving to the document boundary
+ /// The selection moves to the next extended grapheme cluster boundary.
+ ///
+ /// When the movement direction isn't along the line (for example up and
+ /// down for a horizontal line), it moves to the adjacent line using the
+ /// anchor point instead of resolving to the logical direction. This could
+ /// result in a location inside a cluster depending on the specific
+ /// characteristics of a given script. For example, certain Indic scripts
+ /// combine characters in specific ways depending on usage and position to
+ /// form composite characters. The framework returns a location consistent
+ /// with the rules of the script and the direction of movement.
+ NSTextSelectionNavigationDestinationCharacter,
+ /// The selection moves to the next word boundary, ignoring punctuation, whitespace, and format characters preceding the next word.
+ NSTextSelectionNavigationDestinationWord,
+ /// The selection moves to the next line boundary.
+ ///
+ /// The boundary of a line can be logical, based on the line separator
+ /// characters, as well as visual using soft line wrapping.
+ NSTextSelectionNavigationDestinationLine,
+ /// The selection moves to the next sentence boundary, ignoring punctuation, whitespace, and format characters preceding the next sentence.
+ NSTextSelectionNavigationDestinationSentence,
+ /// The selection moves to the next paragraph boundary, ignoring the end-of-line elastic characters and paragraph separators.
+ NSTextSelectionNavigationDestinationParagraph,
+ /// The selection moves to the next container or page boundary, ignoring the end-of-line elastic characters and container/page separators.
+ NSTextSelectionNavigationDestinationContainer,
+ /// The selection moves to the document boundary.
+ NSTextSelectionNavigationDestinationDocument,
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
+/// Values that describe how the framework handles different kinds of selection modifiers.
typedef NS_OPTIONS(NSUInteger, NSTextSelectionNavigationModifier) {
- NSTextSelectionNavigationModifierExtend = (1 << 0), // Extends the selection by not moving the initial location while drag selection
- NSTextSelectionNavigationModifierVisual = (1 << 1), // Extends the selection visually inside the rectangular area defined by the anchor and dragged positions
- NSTextSelectionNavigationModifierMultiple = (1 << 2), // Extends the selection visually inside the rectangular area defined by the anchor and dragged positions and produces an NSTextSelection per line
+ /// The value that indicates the framework extends the selection by not moving the initial location while in a drag selection.
+ NSTextSelectionNavigationModifierExtend = (1 << 0),
+ /// The value that indicates the framework extends the selection visually inside the rectangular area defined by the anchor and drag positions.
+ NSTextSelectionNavigationModifierVisual = (1 << 1),
+ /// The value that indicates the framework extends the selection visually inside the rectangular area defined by the anchor and dragged positions.
+ ///
+ /// This produces an ``NSTextSelection`` per line.
+ NSTextSelectionNavigationModifierMultiple = (1 << 2),
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
+/// Values that describe writing direction for selection navigation.
typedef NS_ENUM(NSInteger, NSTextSelectionNavigationWritingDirection) {
- NSTextSelectionNavigationWritingDirectionLeftToRight = 0, // Left to right writing direction
- NSTextSelectionNavigationWritingDirectionRightToLeft = 1 // Right to left writing direction
+ /// Left-to-right writing direction.
+ NSTextSelectionNavigationWritingDirectionLeftToRight = 0,
+ /// Right-to-left writing direction.
+ NSTextSelectionNavigationWritingDirectionRightToLeft = 1
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
+/// Values that describe text layout orientation for selection navigation.
typedef NS_ENUM(NSInteger, NSTextSelectionNavigationLayoutOrientation) {
- NSTextSelectionNavigationLayoutOrientationHorizontal = 0, // Lines rendered horizontally, grow top to bottom
- NSTextSelectionNavigationLayoutOrientationVertical = 1, // Lines rendered vertically, grow right to left
+ /// Lines render horizontally and grow from top to bottom.
+ NSTextSelectionNavigationLayoutOrientationHorizontal = 0,
+ /// Lines render vertically and grow from right to left.
+ NSTextSelectionNavigationLayoutOrientationVertical = 1,
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos);
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextSelectionNavigation : NSObject
#pragma mark Initialization
+/// Creates a new text selection navigation with the data source you provide.
+///
+/// - Parameters:
+/// - dataSource: The data source providing layout and document content information.
- (instancetype)initWithDataSource:(id <NSTextSelectionDataSource>)dataSource NS_DESIGNATED_INITIALIZER;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark Properties
-// The data source object providing the layout and document content information.
+/// The data source object providing the layout and document content information.
@property (readonly, weak) id <NSTextSelectionDataSource> textSelectionDataSource;
-// If YES, the object could produce selections with multiple disjoint ranges.
+/// A Boolean value that indicates whether the object could produce selections with multiple disjoint ranges.
@property BOOL allowsNonContiguousRanges;
-// If YES, rotates the coordinate system for arguments passed to the navigation methods such as -textSelectionsInteractingAtPoint:inContainerAtLocation:anchors:modifiers:selecting:bounds: based on the text container layout orientation. NO by default.
+/// A Boolean value that indicates whether the coordinate system rotates for navigation methods based on the text container layout orientation.
+///
+/// The default value is `false`.
@property BOOL rotatesCoordinateSystemForLayoutOrientation;
#pragma mark Layout Information Cache
-// Flushes cached layout information. Should be called whenever the document contents get changed.
+/// Flushes cached layout information.
+///
+/// Should be called whenever the document contents change.
- (void)flushLayoutCache;
#pragma mark Selection & Cursor Navigation
-// Returns a text selection moved from textSelection by the navigating operation presented by direction, destination, and extending. Returns nil when the requested operation does not produce any logically valid result. If 'confined' is YES, confine any movement to the text element that the selection already lies within.
+/// Returns a new selection that results from applying the navigation operations you specify to the text selection you provide.
+///
+/// Returns `nil` when the requested operation does not produce any logically
+/// valid result.
+///
+/// - Parameters:
+/// - textSelection: The starting text selection.
+/// - direction: The navigation direction.
+/// - destination: The navigation destination granularity.
+/// - extending: Whether to extend the selection.
+/// - confined: If `true`, confines movement to the text element the selection already lies within.
+///
+/// - Returns: The resulting text selection, or `nil` if the operation is invalid.
- (nullable NSTextSelection *)destinationSelectionForTextSelection:(NSTextSelection *)textSelection direction:(NSTextSelectionNavigationDirection)direction destination:(NSTextSelectionNavigationDestination)destination extending:(BOOL)extending confined:(BOOL)confined;
-// Returns an array of text selections produced with tap/mouse down at point. anchors defines the last text selection state if selecting=YES or NSTextSelectionNavigationModifierExtend. selecting=YES indicates it's in a text selection dragging session. bounds defines the view area in the container coordinate system that can interact with events. It is typically the view's visible area.
+/// Returns an array of text selections produced with a tap or mouse down at the specified point.
+///
+/// - Parameters:
+/// - point: The interaction point in the container coordinate system.
+/// - containerLocation: The location identifying which text container the point belongs to.
+/// - anchors: The last text selection state if `selecting` is `true` or the extend modifier is active.
+/// - modifiers: The active selection modifiers.
+/// - selecting: `true` if currently in a text selection dragging session.
+/// - bounds: The view area in the container coordinate system that can interact with events (typically the view's visible area).
+///
+/// - Returns: An array of text selections for the interaction.
- (NSArray<NSTextSelection *> *)textSelectionsInteractingAtPoint:(CGPoint)point inContainerAtLocation:(id <NSTextLocation>)containerLocation anchors:(NSArray <NSTextSelection *> *)anchors modifiers:(NSTextSelectionNavigationModifier)modifiers selecting:(BOOL)selecting bounds:(CGRect)bounds;
-// Returns a text selection expanded to the nearest boundaries for selectionGranularity enclosing textSelection.textRanges. The returned selection will have granularity=selectionGranularity.
+/// Returns a text selection expanded to the nearest boundaries for the specified granularity enclosing the given selection.
+///
+/// The returned selection will have `granularity` set to `selectionGranularity`.
+///
+/// - Parameters:
+/// - selectionGranularity: The granularity to expand to.
+/// - textSelection: The selection to expand.
+///
+/// - Returns: The expanded text selection.
- (NSTextSelection *)textSelectionForSelectionGranularity:(NSTextSelectionGranularity)selectionGranularity enclosingTextSelection:(NSTextSelection *)textSelection;
-// Returns a text selection expanded to the nearest boundaries for selectionGranularity that contains point in the coordinate system of the text container at containerLocation. The returned selection will have granularity=selectionGranularity.
+/// Returns a text selection expanded to the nearest boundaries for the specified granularity that contains the given point.
+///
+/// The returned selection will have `granularity` set to `selectionGranularity`.
+///
+/// - Parameters:
+/// - selectionGranularity: The granularity to expand to.
+/// - point: The point in the container coordinate system.
+/// - location: The location identifying the text container.
+///
+/// - Returns: The expanded text selection, or `nil`.
- (nullable NSTextSelection *)textSelectionForSelectionGranularity:(NSTextSelectionGranularity)selectionGranularity enclosingPoint:(CGPoint)point inContainerAtLocation:(id <NSTextLocation>)location;
#pragma mark Editing
-// Returns the resolved location for inserting the next input if textSelection is isLogical=NO && secondarySelectionLocation!=nil. If not, returns nil.
+/// Returns the resolved location for inserting the next input when the selection is at a bidirectional boundary.
+///
+/// Returns `nil` if `textSelection` has `isLogical == YES` or
+/// `secondarySelectionLocation == nil`.
+///
+/// - Parameters:
+/// - textSelection: The current text selection.
+/// - writingDirection: The active input writing direction.
+///
+/// - Returns: The resolved insertion location, or `nil`.
- (nullable id <NSTextLocation>)resolvedInsertionLocationForTextSelection:(NSTextSelection *)textSelection writingDirection:(NSTextSelectionNavigationWritingDirection)writingDirection;
-// Returns the ranges that should be deleted based on textSelection and movement arguments. The selection after deletion should contain a 0-length range starting at the location of the first range returned. destination is ignored when textSelection has a non-empty selection. allowsDecomposition only applies to NSTextSelectionNavigationDirectionBackward and NSTextSelectionNavigationDestinationCharacter with 0-length selection.
+/// Returns the ranges that should be deleted based on the text selection and movement arguments.
+///
+/// The selection after deletion should contain a 0-length range starting at the
+/// location of the first range returned. `destination` is ignored when
+/// `textSelection` has a non-empty selection. `allowsDecomposition` only applies
+/// to `NSTextSelectionNavigationDirectionBackward` and
+/// `NSTextSelectionNavigationDestinationCharacter` with a 0-length selection.
+///
+/// - Parameters:
+/// - textSelection: The current text selection.
+/// - direction: The deletion direction.
+/// - destination: The deletion destination granularity.
+/// - allowsDecomposition: Whether to allow character decomposition during backward deletion.
+///
+/// - Returns: An array of ranges to delete.
- (NSArray<NSTextRange *> *)deletionRangesForTextSelection:(NSTextSelection *)textSelection direction:(NSTextSelectionNavigationDirection)direction destination:(NSTextSelectionNavigationDestination)destination allowsDecomposition:(BOOL)allowsDecomposition;
@end
+/// The protocol that provides layout and document content information for text selection navigation.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@protocol NSTextSelectionDataSource <NSObject>
@required
-// Declares the starting and ending locations for the document.
+/// The starting and ending locations for the document.
@property (strong, readonly) NSTextRange *documentRange;
-// Enumerating the textual segment boundaries starting at location. The segmentation logic should be based on the natural language semantics and rules such as Unicode Text Segmentation UAX 29. It is allowed to have custom text segmentation behavior for specialized document contents (i.e. text editors with structured document contents such as a programming language). NSStringEnumerationByLines should be aware of the visual line boundaries based on soft line wrapping.
+/// Enumerates the textual segment boundaries starting at the specified location.
+///
+/// The segmentation logic should be based on the natural language semantics and
+/// rules such as Unicode Text Segmentation UAX 29. It is allowed to have custom
+/// text segmentation behavior for specialized document contents (i.e. text
+/// editors with structured document contents such as a programming language).
+/// `NSStringEnumerationByLines` should be aware of the visual line boundaries
+/// based on soft line wrapping. For forward enumeration, location may be at the
+/// trailing edge of a visual line; the implementation must enumerate into
+/// subsequent content rather than only within the current line fragment.
+///
+/// - Parameters:
+/// - location: The starting location.
+/// - options: One or more <doc://com.apple.documentation/documentation/foundation/nsstring/enumerationoptions> values controlling segmentation type and direction.
+/// - block: A block called for each substring segment.
- (void)enumerateSubstringsFromLocation:(id <NSTextLocation>)location options:(NSStringEnumerationOptions)options usingBlock:(void (NS_NOESCAPE ^)(NSString * _Nullable substring, NSTextRange *substringRange, NSTextRange * _Nullable enclosingRange, BOOL *stop))block;
-// Returns a text range corresponding to selectionGranularity enclosing location. Returns nil when documentRange.isEmpty=YES.
+/// Returns a text range corresponding to the specified granularity enclosing the given location.
+///
+/// Returns `nil` when `documentRange.isEmpty` is `true`. When location falls at a
+/// visual line boundary, results for `NSTextSelectionGranularityLine` should be
+/// consistent with ``lineFragmentRangeForPoint:inContainerAtLocation:`` for the
+/// same position.
+///
+/// - Parameters:
+/// - selectionGranularity: The granularity to expand to.
+/// - location: The document location.
+///
+/// - Returns: The enclosing range, or `nil`.
- (nullable NSTextRange *)textRangeForSelectionGranularity:(NSTextSelectionGranularity)selectionGranularity enclosingLocation:(id <NSTextLocation>)location;
-// Returns a new location from location with offset. The offset value could be positive or negative indicating the logical direction. Could return nil when the inputs don't produce any legal location (i.e. out of bounds index).
+/// Returns a new location from the specified location with the given offset.
+///
+/// The offset value could be positive or negative indicating the logical
+/// direction. Could return `nil` when the inputs don't produce any legal
+/// location (i.e. out of bounds index).
+///
+/// - Parameters:
+/// - location: The base location.
+/// - offset: The offset from the base location.
+///
+/// - Returns: A new location, or `nil` if out of bounds.
- (nullable id <NSTextLocation>)locationFromLocation:(id <NSTextLocation>)location withOffset:(NSInteger)offset;
-// Returns the offset between from and to. The return value could be positive or negative. Could return NSNotFound when the offset cannot be represented in an integer value (i.e. locations are not in the same document).
+/// Returns the offset between the two specified locations.
+///
+/// The return value could be positive or negative. Could return `NSNotFound`
+/// when the offset cannot be represented in an integer value (i.e. locations
+/// are not in the same document). If either location is invalid or
+/// out-of-document, return 0 to avoid arithmetic overflow.
+///
+/// - Parameters:
+/// - from: The starting location.
+/// - to: The ending location.
+///
+/// - Returns: The signed offset, or <doc://com.apple.documentation/documentation/foundation/nsnotfound> if the locations are not in the same document.
- (NSInteger)offsetFromLocation:(id <NSTextLocation>)from toLocation:(id <NSTextLocation>)to;
-// Returns the base writing direction at location. It is recommended to return the resolved base direction either NSTextSelectionNavigationWritingDirectionLeftToRight or NSTextSelectionNavigationWritingDirectionRightToLeft.
+/// Returns the base writing direction at the specified location.
+///
+/// It is recommended to return the resolved base direction, either
+/// `NSTextSelectionNavigationWritingDirectionLeftToRight` or
+/// `NSTextSelectionNavigationWritingDirectionRightToLeft`.
+///
+/// - Parameters:
+/// - location: The document location.
+///
+/// - Returns: An ``NSTextSelectionNavigationWritingDirection``, ideally the resolved base direction (either `NSTextSelectionNavigationWritingDirectionLeftToRight` or `NSTextSelectionNavigationWritingDirectionRightToLeft`).
- (NSTextSelectionNavigationWritingDirection)baseWritingDirectionAtLocation:(id <NSTextLocation>)location;
// Layout
-// Enumerates all the caret offset from left to right in visual order. caretOffset should be in the coordinate system for the text container. When leadingEdge=YES, it indicates caretOffset is at the edge logically preceding the character. For LTR characters, it is on the left, and on the right for RTL characters.
+/// Enumerates all the caret offsets from left to right in visual order.
+///
+/// `caretOffset` is the absolute horizontal position measured from the left edge
+/// of the text container; implementors must account for the line fragment's
+/// origin within the container and the typographic line's position within the
+/// fragment (non-zero for center- or right-aligned text). When `leadingEdge` is
+/// `true`, it indicates `caretOffset` is at the edge logically preceding the
+/// character. For LTR characters, it is on the left, and on the right for RTL
+/// characters. The block must be called twice per character — once for the
+/// leading edge and once for the trailing edge — except for empty line
+/// fragments (e.g. empty paragraphs) where a single leading-edge call is
+/// sufficient. The location objects passed to the block must be positionally
+/// equivalent (via `isEqual:`) to locations returned by other data source
+/// methods for the same document positions.
+///
+/// - Parameters:
+/// - location: A location identifying the line fragment to enumerate.
+/// - block: A block called for each caret offset.
- (void)enumerateCaretOffsetsInLineFragmentAtLocation:(id<NSTextLocation>)location usingBlock:(void (NS_NOESCAPE ^)(CGFloat caretOffset, id <NSTextLocation> location, BOOL leadingEdge, BOOL * stop))block;
-// Returns the range of the line fragment containing point inside the coordinate system containing location.
+/// Returns the range of the line fragment whose visual bounds contain the specified point.
+///
+/// This is a containment test: for points at or past the trailing edge of a
+/// line's last glyph, return the current line fragment's range, not the next.
+/// For multi-container layouts, `location` identifies which text container the
+/// point belongs to.
+///
+/// - Parameters:
+/// - point: The point to test in the container coordinate system.
+/// - location: The location identifying the text container.
+///
+/// - Returns: The line fragment range containing the point, or `nil`.
- (nullable NSTextRange *)lineFragmentRangeForPoint:(CGPoint)point inContainerAtLocation:(id <NSTextLocation>)location;
@optional
-// This optional method should be implemented enumerating the text container/page boundary when the text selection data provider supports such a layout functionality.
+/// Enumerates the text container or page boundaries.
+///
+/// This optional method should be implemented when the text selection data
+/// provider supports container/page boundary layout functionality.
+///
+/// - Parameters:
+/// - location: The starting location.
+/// - reverse: Whether to enumerate in reverse.
+/// - block: A block called for each boundary location.
- (void)enumerateContainerBoundariesFromLocation:(id <NSTextLocation>)location reverse:(BOOL)reverse usingBlock:(void (NS_NOESCAPE ^)(id <NSTextLocation> boundaryLocation, BOOL *stop))block;
-// Returns the text layout orientation at location. If not implemented, NSTextSelectionNavigation assumes it is NSTextSelectionNavigationLayoutOrientationHorizontal.
+/// Returns the text layout orientation at the specified location.
+///
+/// If not implemented, ``NSTextSelectionNavigation`` assumes
+/// `NSTextSelectionNavigationLayoutOrientationHorizontal`.
+///
+/// - Parameters:
+/// - location: The document location.
+///
+/// - Returns: The layout orientation at the location.
- (NSTextSelectionNavigationLayoutOrientation)textLayoutOrientationAtLocation:(id <NSTextLocation>)location;
+
+/// Converts an interaction point from display space into the text container's coordinate system.
+///
+/// `NSTextSelectionNavigation` calls this method before hit-testing to allow the data source to undo any display transform (rotation, flip, path layout, etc.) applied to the text.
+///
+/// - Parameters:
+/// - point: The interaction point in display/view-space coordinates.
+/// - containerLocation: The location identifying the text container the interaction occurred in.
+/// - Returns: The point mapped into the text container's coordinate system. Return `point` unchanged when no transform is active.
+- (CGPoint)convertInteractionPoint:(CGPoint)point toContainerAtLocation:(id<NSTextLocation>)containerLocation API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), visionos(27.0)) API_UNAVAILABLE(watchos);
@end
NS_HEADER_AUDIT_END(nullability, sendability)
#else
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextStorage.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextStorage.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextStorage.h 2026-05-29 23:13:18
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextStorage.h 2026-06-18 00:07:24
@@ -25,73 +25,117 @@
NS_SWIFT_NAME(NSTextStorage.EditActions)
;
-/* Note for subclassing NSTextStorage: NSTextStorage is a semi-abstract subclass of NSMutableAttributedString. It implements change management (beginEditing/endEditing), verification of attributes, delegate handling, and layout management notification. The one aspect it does not implement is the actual attributed string storage --- this is left up to the subclassers, which need to override the two NSMutableAttributedString primitives in addition to two NSAttributedString primitives:
-
- - (NSString *)string;
- - (NSDictionary *)attributesAtIndex:(NSUInteger)location effectiveRange:(NSRangePointer)range;
-
- - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)str;
- - (void)setAttributes:(NSDictionary *)attrs range:(NSRange)range;
-
- These primitives should perform the change then call edited:range:changeInLength: to get everything else to happen.
-*/
-
+/// The fundamental storage mechanism of TextKit that contains the text managed by the system.
+///
+/// `NSTextStorage` is a semi-abstract subclass of `NSMutableAttributedString`.
+/// It implements change management (`beginEditing`/`endEditing`), verification
+/// of attributes, delegate handling, and layout management notification. The one
+/// aspect it does not implement is the actual attributed string storage — this
+/// is left up to subclassers, which need to override the two
+/// `NSMutableAttributedString` primitives in addition to two
+/// `NSAttributedString` primitives:
+///
+/// - `-string`
+/// - `-attributesAtIndex:effectiveRange:`
+/// - `-replaceCharactersInRange:withString:`
+/// - `-setAttributes:range:`
+///
+/// These primitives should perform the change then call
+/// `edited:range:changeInLength:` to get everything else to happen.
UIKIT_EXTERN API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextStorage : NSMutableAttributedString <NSSecureCoding>
/**************************** Pending edit info ****************************/
-// These methods return information about the editing status. Especially useful when there are outstanding beginEditing calls or during processEditing...
-// The NSTextStorageEditActions mask indicating that there are pending changes for attributes, characters, or both.
+/// A mask that describes the kinds of edits pending for the text storage object.
@property (readonly, NS_NONATOMIC_IOSONLY) NSTextStorageEditActions editedMask;
-// The range for pending changes. {NSNotFound, 0} when there is no pending changes.
+/// The range of text that contains changes.
+///
+/// `{NSNotFound, 0}` when there is no pending changes.
@property (readonly, NS_NONATOMIC_IOSONLY) NSRange editedRange;
-// The length delta for the pending changes.
+/// The difference between the current length of the edited range and its length before editing.
@property (readonly, NS_NONATOMIC_IOSONLY) NSInteger changeInLength;
/**************************** Delegate ****************************/
+/// The delegate for the text storage object.
@property (nullable, weak, NS_NONATOMIC_IOSONLY) id <NSTextStorageDelegate> delegate;
/**************************** Edit management ****************************/
-// Notifies and records a recent change. If there are no outstanding -beginEditing calls, this method calls -processEditing to trigger post-editing processes. This method has to be called by the primitives after changes are made if subclassed and overridden. editedRange is the range in the original string (before the edit).
+/// Tracks changes made to the text storage object, allowing the text storage to record the full extent of changes.
+///
+/// If there are no outstanding `beginEditing` calls, this method calls
+/// ``processEditing`` to trigger post-editing processes. This method has to be
+/// called by the primitives after changes are made if subclassed and overridden.
+/// `editedRange` is the range in the original string (before the edit).
+///
+/// - Parameters:
+/// - editedMask: The type of edit (attributes, characters, or both).
+/// - editedRange: The range in the original string before the edit.
+/// - delta: The change in length resulting from the edit.
- (void)edited:(NSTextStorageEditActions)editedMask range:(NSRange)editedRange changeInLength:(NSInteger)delta;
-// Sends out -textStorage:willProcessEditing, fixes the attributes, sends out -textStorage:didProcessEditing, and notifies the layout managers of change with the -processEditingForTextStorage:edited:range:changeInLength:invalidatedRange: method. Invoked from -edited:range:changeInLength: or -endEditing.
+/// Sends out delegate notifications, fixes the attributes, and notifies text storage observer of the change.
+///
+/// Sends `-textStorage:willProcessEditing`, fixes the attributes, sends
+/// `-textStorage:didProcessEditing`, and notifies the text storage observer of change
+/// with `-processEditingForTextStorage:edited:range:changeInLength:invalidatedRange:`.
+/// Invoked from ``edited:range:changeInLength:`` or `endEditing`.
- (void)processEditing;
/**************************** Attribute fixing ****************************/
-// Indicates if the receiver fixes invalidated attributes lazily. The concrete UIKit subclass fixes attributes lazily by default. The abstract class (hence, all custom subclasses) is not lazy.
+/// A Boolean value that indicates whether the receiver fixes invalidated attributes lazily.
+///
+/// The concrete UIKit subclass fixes attributes lazily by default. The abstract
+/// class (hence, all custom subclasses) is not lazy.
@property (readonly, NS_NONATOMIC_IOSONLY) BOOL fixesAttributesLazily;
-// Notes the range of attributes that requires validation. If the NSTextStorage is not lazy this just calls fixAttributesInRange:. If it is lazy this instead just records the range needing fixing in order to do it later.
+/// Notes the range of attributes that requires validation.
+///
+/// If the `NSTextStorage` is not lazy this just calls
+/// `fixAttributesInRange:`. If it is lazy this instead just records the range
+/// needing fixing in order to do it later.
+///
+/// - Parameters:
+/// - range: The range of attributes to invalidate.
- (void)invalidateAttributesInRange:(NSRange)range;
-// Ensures all attributes in range are validated and ready to be used. An NSTextStorage that is lazy is required to call the following method before accessing any attributes. This gives the attribute fixing a chance to occur if necessary. NSTextStorage subclasses that wish to support laziness must call it from all attribute accessors that they implement. The default concrete subclass does call this from its accessors.
+/// Ensures all attributes in the range are validated and ready to be used.
+///
+/// A lazy `NSTextStorage` is required to call this method before accessing any
+/// attributes. This gives the attribute fixing a chance to occur if necessary.
+/// Subclasses that wish to support laziness must call it from all attribute
+/// accessors that they implement.
+///
+/// - Parameters:
+/// - range: The range to ensure attributes are fixed in.
- (void)ensureAttributesAreFixedInRange:(NSRange)range;
/**************************** NSTextStorageObserving ****************************/
-// An object conforming to NSTextStorageObserving observing and retaining NSTextStorage
+/// An object conforming to `NSTextStorageObserving` that observes and retains the text storage.
@property (nullable, weak, NS_NONATOMIC_IOSONLY) id <NSTextStorageObserving> textStorageObserver API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
@end
-/**** NSTextStorage delegate methods ****/
-
+/// The optional methods that delegates of text storage objects implement.
API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@protocol NSTextStorageDelegate <NSObject>
@optional
-// Sent inside -processEditing right before fixing attributes. Delegates can change the characters or attributes.
+/// Sent inside `processEditing` right before fixing attributes.
+///
+/// Delegates can change the characters or attributes.
- (void)textStorage:(NSTextStorage *)textStorage willProcessEditing:(NSTextStorageEditActions)editedMask range:(NSRange)editedRange changeInLength:(NSInteger)delta API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos);
-// Sent inside -processEditing right before notifying layout managers. Delegates can change the attributes.
+/// Sent inside `processEditing` right before notifying text storage observer.
+///
+/// Delegates can change the attributes.
- (void)textStorage:(NSTextStorage *)textStorage didProcessEditing:(NSTextStorageEditActions)editedMask range:(NSRange)editedRange changeInLength:(NSInteger)delta API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos);
@end
@@ -102,16 +146,33 @@
UIKIT_EXTERN NSNotificationName const NSTextStorageDidProcessEditingNotification API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0), visionos(1.0)) API_UNAVAILABLE(watchos);
#pragma mark NSTextStorageObserving
-// NSTextStorageObserving defines the protocol for NSTextStorage controller objects observing changes in the text backing-store.
+/// A protocol that defines the interface for objects observing changes in the text backing-store.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@protocol NSTextStorageObserving <NSObject>
-// The document object
+/// The document text storage object.
@property (nullable, strong, NS_NONATOMIC_IOSONLY) NSTextStorage *textStorage;
-// The newCharRange is the range in the final string which was explicitly edited. The invalidatedRange includes portions that changed as a result of attribute fixing. invalidatedRange is either equal to newCharRange or larger. Controllers should not change the contents of the text storage during the execution of this message.
+/// Notifies the observer that the text storage has been edited.
+///
+/// The `newCharRange` is the range in the final string which was explicitly
+/// edited. The `invalidatedRange` includes portions that changed as a result of
+/// attribute fixing — it is either equal to `newCharRange` or larger.
+/// Controllers should not change the contents of the text storage during the
+/// execution of this message.
+///
+/// - Parameters:
+/// - textStorage: The text storage that was edited.
+/// - editMask: The type of edit.
+/// - newCharRange: The range of characters that changed.
+/// - delta: The change in length.
+/// - invalidatedCharRange: The full invalidated range including attribute fixing.
- (void)processEditingForTextStorage:(NSTextStorage *)textStorage edited:(NSTextStorageEditActions)editMask range:(NSRange)newCharRange changeInLength:(NSInteger)delta invalidatedRange:(NSRange)invalidatedCharRange;
-// Transactional editing support
+/// Performs an editing transaction on the text storage.
+///
+/// - Parameters:
+/// - textStorage: The text storage.
+/// - transaction: The block to execute within the transaction.
- (void)performEditingTransactionForTextStorage:(NSTextStorage *)textStorage usingBlock:(void (NS_NOESCAPE ^) (void))transaction;
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextTable.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextTable.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextTable.h 2026-06-01 00:34:57
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextTable.h 2026-06-18 01:49:53
@@ -61,7 +61,7 @@
} API_AVAILABLE(macos(10.0), ios(6.0), tvos(9.0), visionos(1.0), watchos(2.0)) NS_SWIFT_NAME(NSTextTable.LayoutAlgorithm);
-/* NSTextBlock is the basic object for text block layout, and the superclass of the other classes. */
+/// An object that defines the size, spacing, and appearance of a block of text in an attributed string.
UIKIT_EXTERN API_AVAILABLE(macos(10.0), ios(6.0), tvos(9.0), visionos(1.0), watchos(2.0))
@interface NSTextBlock : NSObject <NSSecureCoding, NSCopying>
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@@ -93,7 +93,7 @@
- (nullable UIColor *)borderColorForRectEdge:(CGRectEdge)rectEdge API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), visionos(27.0), watchos(27.0));
@end
-/* NSTextTableBlock is a subclass of NSTextBlock used for a block that appears as a cell in a text table. */
+/// An object that represents a single cell in a text table.
UIKIT_EXTERN API_AVAILABLE(macos(10.0), ios(6.0), tvos(9.0), visionos(1.0), watchos(2.0))
@interface NSTextTableBlock : NSTextBlock
- (instancetype)initWithTable:(NSTextTable *)table startingRow:(NSInteger)row rowSpan:(NSInteger)rowSpan startingColumn:(NSInteger)column columnSpan:(NSInteger)columnSpan NS_DESIGNATED_INITIALIZER; // Designated initializer
@@ -108,7 +108,7 @@
@end
-/* NSTextTable represents a table as a whole. */
+/// An object that represents a table of rows and columns in an attributed string.
UIKIT_EXTERN API_AVAILABLE(macos(10.0), ios(6.0), tvos(9.0), visionos(1.0), watchos(2.0))
@interface NSTextTable : NSTextBlock
/* These methods control the basic parameters of the table. */
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextViewportLayoutController.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextViewportLayoutController.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextViewportLayoutController.h 2026-05-29 23:05:23
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextViewportLayoutController.h 2026-06-18 00:23:35
@@ -19,42 +19,96 @@
NS_HEADER_AUDIT_BEGIN(nullability, sendability)
-// A viewport is a rectangular area within a flipped coordinate system expanding along the y-axis. With text contents, lines advance along the expanding direction typically. It defines the active area where text layout fragments laid out. The area corresponds to the user visible area with additional over-scroll region in most cases. NSTextViewportLayoutController manages the layout process inside the viewport interacting with its delegate.
+/// Manages the layout process inside the viewport interacting with its delegate.
+///
+/// A viewport is a rectangular area within a flipped coordinate system expanding
+/// along the y-axis. With text contents, lines advance along the expanding
+/// direction typically. It defines the active area where text layout fragments
+/// are laid out. The area corresponds to the user visible area with additional
+/// over-scroll region in most cases.
#pragma mark NSTextViewportLayoutControllerDelegate
+/// The protocol that viewport layout controller delegates implement to manage layout and rendering surfaces.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@protocol NSTextViewportLayoutControllerDelegate <NSObject>
#pragma mark Properties
-// The current viewport, typically the view visible bounds with overdraw.
+/// Returns the current viewport bounds, typically the view visible bounds with overdraw.
+///
+/// - Parameters:
+/// - textViewportLayoutController: The viewport layout controller requesting the bounds.
+///
+/// - Returns: The viewport bounds rect.
- (CGRect)viewportBoundsForTextViewportLayoutController:(NSTextViewportLayoutController *)textViewportLayoutController;
#pragma mark Viewport layout
-// Called when textViewportLayoutController lays out a given textLayoutFragment.
-// The delegate should arrange to present the text layout fragment in the UI, e.g. a sublayer/subview.
-// Layout information such as viewportBounds on textViewportLayoutController is not up-to-date at the point of this call.
+/// Called when the viewport layout controller lays out a given text layout fragment.
+///
+/// The delegate should arrange to present the text layout fragment in the UI,
+/// e.g. a sublayer or subview. Layout information such as `viewportBounds` on
+/// `textViewportLayoutController` is not up-to-date at the point of this call.
+///
+/// - Parameters:
+/// - textViewportLayoutController: The viewport layout controller.
+/// - textLayoutFragment: The layout fragment to configure a rendering surface for.
- (void)textViewportLayoutController:(NSTextViewportLayoutController *)textViewportLayoutController configureRenderingSurfaceForTextLayoutFragment:(NSTextLayoutFragment *)textLayoutFragment;
@optional
#pragma mark Layout Process Observation
-// Called when textViewportLayoutController is about to layout.
-// Layout information on textViewportLayoutController is up-to-date at the point of this call.
+/// Called when the viewport layout controller is about to layout.
+///
+/// Layout information on `textViewportLayoutController` is up-to-date at the
+/// point of this call.
+///
+/// - Parameters:
+/// - textViewportLayoutController: The viewport layout controller about to layout.
- (void)textViewportLayoutControllerWillLayout:(NSTextViewportLayoutController *)textViewportLayoutController;
-// Called when textViewportLayoutController is about to layout.
-// Layout information on textViewportLayoutController is up-to-date at the point of this call.
+/// Called when the viewport layout controller has finished layout.
+///
+/// Layout information on `textViewportLayoutController` is up-to-date at the
+/// point of this call.
+///
+/// - Parameters:
+/// - textViewportLayoutController: The viewport layout controller that finished layout.
- (void)textViewportLayoutControllerDidLayout:(NSTextViewportLayoutController *)textViewportLayoutController;
-// View Provider Caching Support
+/// Asks the delegate to cache a rendering surface for later retrieval.
+///
+/// - Parameters:
+/// - textViewportLayoutController: The viewport layout controller.
+/// - renderingSurface: The rendering surface to cache.
+/// - renderingSurfaceKey: The key identifying the rendering surface.
- (void)textViewportLayoutController:(NSTextViewportLayoutController *)textViewportLayoutController cacheRenderingSurface:(id<NSTextViewportRenderingSurface>)renderingSurface forKey:(id<NSTextViewportRenderingSurfaceKey>)renderingSurfaceKey;
+/// Asks the delegate to return a previously cached rendering surface.
+///
+/// - Parameters:
+/// - textViewportLayoutController: The viewport layout controller.
+/// - renderingSurfaceKey: The key identifying the rendering surface.
+///
+/// - Returns: The cached rendering surface, or `nil`.
- (id<NSTextViewportRenderingSurface>)textViewportLayoutController:(NSTextViewportLayoutController *)textViewportLayoutController retrieveCachedRenderingSurfaceForKey:(id<NSTextViewportRenderingSurfaceKey>)renderingSurfaceKey;
-// Triggers relayout of the view.
+/// Triggers relayout of the view.
+///
+/// - Parameters:
+/// - textViewportLayoutController: The viewport layout controller requesting a relayout.
- (void)textViewportLayoutControllerReceivedSetNeedsLayout:(NSTextViewportLayoutController *)textViewportLayoutController;
#pragma mark NSTextViewportRenderingSurface support
-// Invoked right before textViewportLayoutController:configureRenderingSurfaceForTextLayoutFragment:. The returned rendering surface is registered and mapped by renderingSurfaceForKey:.
+/// Returns a rendering surface for the specified text layout fragment.
+///
+/// Invoked right before
+/// `textViewportLayoutController:configureRenderingSurfaceForTextLayoutFragment:`.
+/// The returned rendering surface is registered and mapped by
+/// ``renderingSurfaceForKey:``.
+///
+/// - Parameters:
+/// - textViewportLayoutController: The viewport layout controller.
+/// - textLayoutFragment: The layout fragment needing a rendering surface.
+///
+/// - Returns: A rendering surface, or `nil`.
- (nullable id <NSTextViewportRenderingSurface>)textViewportLayoutController:(NSTextViewportLayoutController *)textViewportLayoutController renderingSurfaceForTextLayoutFragment:(NSTextLayoutFragment *)textLayoutFragment API_UNAVAILABLE(macos, ios, tvos, visionos, watchos);
@end
@@ -63,42 +117,71 @@
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), visionos(1.0)) API_UNAVAILABLE(watchos)
@interface NSTextViewportLayoutController : NSObject
#pragma mark Initialization
+/// Creates a new viewport layout controller with the specified text layout manager.
+///
+/// - Parameters:
+/// - textLayoutManager: The text layout manager providing layout fragments.
- (instancetype)initWithTextLayoutManager:(NSTextLayoutManager *)textLayoutManager NS_DESIGNATED_INITIALIZER;
+
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark Properties
-// The viewport layout delegate.
+/// The viewport layout delegate.
@property (nullable, weak) id <NSTextViewportLayoutControllerDelegate> delegate;
-// The provider of viewport text layout fragments.
+/// The text layout manager for this viewport layout controller.
@property (weak, readonly) NSTextLayoutManager *textLayoutManager;
+
#pragma mark Viewport layout state
-// The viewport of the current layout.
-// Not KVO-compliant.
+/// The visible bounds of the view, plus the overdraw area.
+///
+/// Not KVO-compliant.
@property (readonly) CGRect viewportBounds;
-// The text range of the current viewport layout.
-// Not KVO-compliant.
+/// The text range of the current viewport layout.
+///
+/// Not KVO-compliant.
@property (nullable, readonly) NSTextRange *viewportRange;
#pragma mark Viewport layout
-// Performs layout in the viewport.
+/// Performs layout in the viewport.
- (void)layoutViewport;
-// Relocates the viewport to start with the specified *location*.
-// This is used to programmatically scroll to the specified *location*.
-// Returns the suggested viewport anchor point.
+/// Relocates the viewport to start with the specified location.
+///
+/// This is used to programmatically scroll to the specified location.
+///
+/// - Parameters:
+/// - textLocation: The document location to scroll to.
+///
+/// - Returns: The suggested viewport anchor point.
- (CGFloat)relocateViewportToTextLocation:(id <NSTextLocation>)textLocation;
-// Adjusts the viewport rect by the specified offset if needed.
-// This is used to artificially move the viewport without affecting viewport content, can be both positive/negative offset.
+/// Adjusts the viewport rect by the specified offset if needed.
+///
+/// This is used to artificially move the viewport without affecting viewport
+/// content. The offset can be both positive and negative.
+///
+/// - Parameters:
+/// - verticalOffset: The vertical offset to adjust by.
- (void)adjustViewportByVerticalOffset:(CGFloat)verticalOffset;
#pragma mark NSTextViewportRenderingSurface support
-// Returns a rendering surface corresponding to key. The mapping is registered via the returned rendering surfaces from textViewportLayoutController:renderingSurfaceForTextLayoutFragment:. In addition, it can return auxiliary rendering surfaces registered through addRenderingSurface:key:group:placement:. The mappings are cleared at the beginning of each layoutViewport.
+/// Returns a rendering surface corresponding to the specified key.
+///
+/// The mapping is registered via the returned rendering surfaces from
+/// `textViewportLayoutController:renderingSurfaceForTextLayoutFragment:`. In
+/// addition, it can return auxiliary rendering surfaces registered through
+/// `addRenderingSurface:key:group:placement:`. The mappings are cleared at the
+/// beginning of each ``layoutViewport``.
+///
+/// - Parameters:
+/// - key: The key identifying the rendering surface.
+///
+/// - Returns: The rendering surface, or `nil`.
- (nullable id <NSTextViewportRenderingSurface>)renderingSurfaceForKey:(id <NSTextViewportRenderingSurfaceKey>)key API_UNAVAILABLE(macos, ios, tvos, visionos, watchos);
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextViewportRenderingSurface.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextViewportRenderingSurface.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextViewportRenderingSurface.h 2026-05-30 22:15:06
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/NSTextViewportRenderingSurface.h 2026-06-18 01:49:53
@@ -10,14 +10,18 @@
#import <UIKit/UIKitDefines.h>
#pragma mark - NSTextViewportRenderingSurface
-// A visual drawable element inside the viewport corresponding to a NSTextParagraph and NSTextLayoutFragment . Typically an NSView, UIView or CALayer.
+/// A protocol that identifies a view or layer as a drawable element for a text layout fragment.
+///
+/// Typically an `NSView`, `UIView`, or `CALayer`.
API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), visionos(27.0), watchos(27.0))
@protocol NSTextViewportRenderingSurface <NSObject>
@end
#pragma mark - NSTextViewportRenderingSurfaceKey
-// The key for identifying a rendering surface inside a viewport. NSString and NSTextLayoutFragment conform to this protocol.
+/// A protocol that lets you use an object to identify a rendering surface when storing or retrieving it.
+///
+/// `NSString` and ``NSTextLayoutFragment`` conform to this protocol.
API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), visionos(2.0), watchos(11.0))
@protocol NSTextViewportRenderingSurfaceKey <NSObject>
@end
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h 2026-05-27 00:33:22
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h 2026-06-18 01:15:49
@@ -125,7 +125,7 @@
// UIInterfaceOrientationMaskAllButUpsideDown on a phone. The return value
// should be one of the UIInterfaceOrientationMask values which indicates the
// orientations supported by this application.
-- (UIInterfaceOrientationMask)supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window API_DEPRECATED("Use UIWindowSceneDelegate.supportedInterfaceOrientations(for:) instead", ios(6.0, 27.0)) API_UNAVAILABLE(tvos, visionos, watchos);
+- (UIInterfaceOrientationMask)supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window API_DEPRECATED("Use UIWindowSceneDelegate.supportedInterfaceOrientations(for:) instead", ios(6.0, 27.0)) API_UNAVAILABLE(tvos, watchos);
@property(nonatomic,readonly) NSTimeInterval statusBarOrientationAnimationDuration API_DEPRECATED("Use viewWillTransitionToSize:withTransitionCoordinator: instead.", ios(2.0, 13.0)) API_UNAVAILABLE(tvos) API_UNAVAILABLE(visionos, watchos); // Returns the animation duration for the status bar during a 90 degree orientation change. It should be doubled for a 180 degree orientation change.
@property(nonatomic,readonly) CGRect statusBarFrame API_DEPRECATED("Use the statusBarManager property of the window scene instead.", ios(2.0, 13.0)) API_UNAVAILABLE(tvos) API_UNAVAILABLE(visionos, watchos); // returns CGRectZero if the status bar is hidden
@@ -453,7 +453,7 @@
@property (nullable, nonatomic, strong) UIWindow *window API_AVAILABLE(ios(5.0));
-- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window API_DEPRECATED("Use UIWindowSceneDelegate.supportedInterfaceOrientations(for:) instead", ios(6.0, 27.0)) API_UNAVAILABLE(tvos, visionos, watchos);
+- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window API_DEPRECATED("Use UIWindowSceneDelegate.supportedInterfaceOrientations(for:) instead", ios(6.0, 27.0)) API_UNAVAILABLE(tvos, watchos);
typedef NSString * UIApplicationExtensionPointIdentifier NS_TYPED_ENUM API_UNAVAILABLE(watchos);
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentViewControllerLaunchOptions.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentViewControllerLaunchOptions.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentViewControllerLaunchOptions.h 2026-05-30 22:33:48
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentViewControllerLaunchOptions.h 2026-06-18 02:15:45
@@ -21,10 +21,10 @@
/// The view controller for browsing documents to open.
@property (nonatomic, strong) UIDocumentBrowserViewController *browserViewController;
-/// The title of the view. Default is the application's name.
+/// The title of the launch view. Default is the application's name.
@property (nonatomic, copy) NSString *title;
-/// The subtitle of the view. Default is `nil`.
+/// The subtitle of the launch view. Default is `nil`.
/// If `nil`, no subtitle will be displayed.
@property (nonatomic, copy, nullable) NSString *subtitle API_AVAILABLE(ios(27.0));
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFoundation.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFoundation.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFoundation.h 2026-05-30 22:15:05
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIFoundation.h 2026-06-18 01:49:52
@@ -28,4 +28,5 @@
#import <UIKit/NSTextStorage.h>
#import <UIKit/NSAttributedString.h>
#import <UIKit/NSTextTable.h>
+
#import <UIKit/NSLayoutManager.h>
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h 2026-05-23 02:19:38
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKitCore.h 2026-06-18 00:48:07
@@ -404,6 +404,7 @@
#import <UIKit/UIWritingToolsCoordinatorContext.h>
#import <UIKit/UIWritingToolsCoordinatorAnimationParameters.h>
#import <UIKit/UIInputSuggestion.h>
+#import <UIKit/UIPhotoSearchSuggestion.h>
#import <UIKit/UISmartReplySuggestion.h>
#import <UIKit/UIConversationContext.h>
#import <UIKit/UIConversationEntry.h>
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPhotoSearchSuggestion.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPhotoSearchSuggestion.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPhotoSearchSuggestion.h 1969-12-31 19:00:00
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPhotoSearchSuggestion.h 2026-06-18 02:15:36
@@ -0,0 +1,68 @@
+#if (defined(USE_UIKIT_PUBLIC_HEADERS) && USE_UIKIT_PUBLIC_HEADERS) || !__has_include(<UIKitCore/UIPhotoSearchSuggestion.h>)
+//
+// UIPhotoSearchSuggestion.h
+// UIKit
+//
+// Copyright © 2026 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKitDefines.h>
+#import <UIKit/UIInputSuggestion.h>
+
+NS_HEADER_AUDIT_BEGIN(nullability, sendability)
+
+/// A class you use to handle a photo search suggestion
+///
+/// When the system detects text that could be used to search a user's photo library,
+/// it provides a `UIPhotoSearchSuggestion` through the input suggestion system.
+/// Your app can use the filter metadata (who, what, where, when) to construct queries
+/// using the Photos framework.
+///
+/// You receive photo search suggestions through the
+/// ``UITextFieldDelegate/textField(_:insertInputSuggestion:)`` or
+/// ``UITextViewDelegate/textView(_:insertInputSuggestion:)`` delegate methods.
+///
+/// ## Example
+///
+/// ```swift
+/// func textField(_ textField: UITextField,
+/// insertInputSuggestion inputSuggestion: UIInputSuggestion) {
+/// if let photoSuggestion = inputSuggestion as? UIPhotoSearchSuggestion {
+/// performPhotoSearch(photoSuggestion)
+/// }
+/// }
+/// ```
+UIKIT_EXTERN API_AVAILABLE(ios(27.0)) API_UNAVAILABLE(macCatalyst) API_UNAVAILABLE(tvos, watchos, visionos)
+@interface UIPhotoSearchSuggestion : UIInputSuggestion
+
+- (instancetype)init NS_UNAVAILABLE;
+
+/// People mentioned in the text that can be used to filter photos.
+///
+/// For example, if the user types "photos with John," this array might contain `@[@"John"]`.
+@property (nonatomic, copy, readonly) NSArray<NSString *> *whoValues;
+
+/// Subjects or topics mentioned in the text that can be used to filter photos.
+///
+/// For example, if the user types "photos of food," this array might contain `@[@"food"]`.
+@property (nonatomic, copy, readonly) NSArray<NSString *> *whatValues;
+
+/// Locations mentioned in the text that can be used to filter photos.
+///
+/// For example, if the user types "pictures from Paris," this array might contain `@[@"Paris"]`.
+@property (nonatomic, copy, readonly) NSArray<NSString *> *whereValues;
+
+/// Time periods mentioned in the text that can be used to filter photos.
+///
+/// For example, if the user types "photos from last summer," this array might
+/// contain `@[@"last summer"]`.
+@property (nonatomic, copy, readonly) NSArray<NSString *> *whenValues;
+
+@end
+
+NS_HEADER_AUDIT_END(nullability, sendability)
+
+#else
+#import <UIKitCore/UIPhotoSearchSuggestion.h>
+#endif
diff -ruN /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextChecker.h /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextChecker.h
--- /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextChecker.h 2026-05-30 22:33:49
+++ /Applications/Xcode_27.0.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextChecker.h 2026-06-18 01:11:17
@@ -38,6 +38,12 @@
/* Entries in the availableLanguages list are all available spellchecking languages in user preference order, usually language abbreviations such as en_US. */
@property(class, nonatomic, readonly) NSArray<NSString *> *availableLanguages;
+/* Requests grammar checking in the background. The completion handler will be called when results are available, with an array of NSTextCheckingResult objects describing particular items found during checking and their individual ranges, sorted by range origin, then range end, then result type. The result type may be either NSTextCheckingTypeGrammar or NSTextCheckingTypeCorrection. If waitForAllResults is true, this will not return until all grammar analysis has been performed; otherwise, the request will include those grammar results that are available quickly. */
+- (void)requestGrammarCheckingOfString:(NSString *)stringToCheck range:(NSRange)range waitForAllResults:(BOOL)waitForAllResults completionHandler:(void (^ _Nullable)(NSArray<NSTextCheckingResult *> *results))completionHandler API_AVAILABLE(ios(27.0), tvos(27.0), macos(27.0), visionos(27.0));
+
+/* This method should be called to ignore a particular grammar issue. The sentence should be the portion of the text corresponding to the range of an NSTextCheckingResult of grammar type. The grammarRange should be the range within that sentence of an individual issue, taken from the NSGrammarRange entry of one of the grammarDetails of the same NSTextCheckingResult. */
+- (void)ignoreGrammarRange:(NSRange)grammarRange inSentence:(NSString *)sentence API_AVAILABLE(ios(27.0), tvos(27.0), macos(27.0), visionos(27.0));
+
@end
NS_HEADER_AUDIT_END(nullability, sendability)