Skip to content

AppKit macOS xcode13.0 beta2

Rachel Kang edited this page Oct 8, 2021 · 4 revisions

#AppKit.framework https://github.com/xamarin/xamarin-macios/pull/12936

diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes	2021-06-01 21:24:05.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.apinotes	2021-06-17 01:35:49.000000000 -0400
@@ -2390,10 +2390,6 @@
     SwiftName: NSApplicationDidBecomeActive
   - Name: NSApplicationDidChangeOcclusionStateNotification
     SwiftName: NSApplicationDidChangeOcclusionState
-  - Name: NSApplicationProtectedDataWillBecomeUnavailableNotification
-    SwiftName: NSApplicationProtectedDataWillBecomeUnavailable
-  - Name: NSApplicationProtectedDataDidBecomeAvailableNotification
-    SwiftName: NSApplicationProtectedDataDidBecomeAvailable
   - Name: NSApplicationDidChangeScreenParametersNotification
     SwiftName: NSApplicationDidChangeScreenParameters
   - Name: NSApplicationDidFinishLaunchingNotification
@@ -4585,8 +4581,6 @@
     SwiftName: "NSImage.Name.columnViewTemplate"
   - Name: NSImageNameComputer
     SwiftName: "NSImage.Name.computer"
-  - Name: NSImageNameDotMac NS_DEPRECATED_MAC(10_5, 10_7);
-    SwiftName: "NSImage.Name.dotMac"
   - Name: NSImageNameEnterFullScreenTemplate
     SwiftName: "NSImage.Name.enterFullScreenTemplate"
   - Name: NSImageNameEveryone
@@ -6036,6 +6030,11 @@
   - Selector: init
     MethodKind: Instance
     DesignatedInit: true
+- Name: NSTextContentStorage
+  Methods:
+  - Selector: "locationFromLocation:withOffset:"
+    MethodKind: Instance
+    SwiftName: location(_:offsetBy:)
 - Name: NSTextField
   Methods:
   - Selector: "labelWithAttributedString:"
@@ -6068,57 +6067,60 @@
     DesignatedInit: true
 - Name: NSTextLayoutManager
   Methods:
-  - Selector: "replaceTextContentManager:"
-    MethodKind: Instance
-    SwiftName: replace(_:)
   - Selector: "ensureLayoutForBounds:"
     MethodKind: Instance
     SwiftName: ensureLayout(for:)
+  - Selector: "replaceTextContentManager:"
+    MethodKind: Instance
+    SwiftName: replace(_:)
   - Selector: "textLayoutFragmentForPosition:"
     MethodKind: Instance
     SwiftName: textLayoutFragment(for:)
 - Name: NSTextRange
   Methods:
-  - Selector: "initWithLocation:"
-    MethodKind: Instance 
-    SwiftName: init(location:)
   - Selector: "containsLocation:"
     MethodKind: Instance
     SwiftName: contains(_:)
   - Selector: "containsRange:"
     MethodKind: Instance
     SwiftName: contains(_:)
+  - Selector: "initWithLocation:"
+    MethodKind: Instance
+    SwiftName: init(location:)
   - Selector: "intersectsWithTextRange:"
     MethodKind: Instance
     SwiftName: intersects(_:)
-  - Selector: "textRangeByIntersectingWithTextRange:"
-    MethodKind: Instance
-    SwiftName: intersection(_:)
   - Selector: "textRangeByFormingUnionWithTextRange:"
     MethodKind: Instance
     SwiftName: union(_:)
+  - Selector: "textRangeByIntersectingWithTextRange:"
+    MethodKind: Instance
+    SwiftName: intersection(_:)
 - Name: NSTextSelection
   Methods:
-  - Selector: "initWithRanges:affinity:granularity:"
-    MethodKind: Instance 
-    SwiftName: init(_:affinity:granularity:)
+  - Selector: "initWithLocation:affinity:"
+    MethodKind: Instance
+    SwiftName: init(_:affinity:)
   - Selector: "initWithRange:affinity:granularity:"
     MethodKind: Instance
     SwiftName: init(_:affinity:granularity:)
-  - Selector: "initWithLocation:affinity:"
+  - Selector: "initWithRanges:affinity:granularity:"
     MethodKind: Instance
-    SwiftName: init(_:affinity:)
+    SwiftName: init(_:affinity:granularity:)
+  - Selector: "textSelectionWithTextRanges:"
+    MethodKind: Instance
+    SwiftName: textSelection(_:)
 - Name: NSTextSelectionNavigation
   Methods:
-  - Selector: "textSelectionsInteractingAtPoint:inContainerAtLocation:anchors:modifiers:selecting:bounds:"
+  - Selector: "textSelectionForSelectionGranularity:enclosingPoint:inContainerAtLocation:"
     MethodKind: Instance
-    SwiftName: textSelections(interactingAt:containerLocation:anchors:modifiers:selecting:bounds:)
+    SwiftName: textSelection(for:enclosing:inContainerAt:)
   - Selector: "textSelectionForSelectionGranularity:enclosingTextSelection:"
     MethodKind: Instance
-    SwiftName: textSelections(for:enclosing:)
-  - Selector: "textSelectionForSelectionGranularity:enclosingPoint:inContainerAtLocation:"
+    SwiftName: textSelection(for:enclosing:)
+  - Selector: "textSelectionsInteractingAtPoint:inContainerAtLocation:anchors:modifiers:selecting:bounds:"
     MethodKind: Instance
-    SwiftName: textSelection(for:enclosing:inContainerAt:)
+    SwiftName: textSelections(interactingAt:inContainerAt:anchors:modifiers:selecting:bounds:)
 - Name: NSTextTableBlock
   Methods:
   - Selector: "initWithTable:startingRow:rowSpan:startingColumn:columnSpan:"
@@ -6495,6 +6497,12 @@
     DesignatedInit: true
 - Name: NSWorkspace
   Methods:
+  - Selector: "URLForApplicationToOpenContentType:"
+    MethodKind: Instance
+    SwiftName: "urlForApplication(toOpen:)"
+  - Selector: "URLsForApplicationsToOpenContentType:"
+    MethodKind: Instance
+    SwiftName: "urlsForApplications(toOpen:)"
   - Selector: "absolutePathForAppBundleWithIdentifier:"
     MethodKind: Instance
     SwiftName: absolutePathForApplication(withBundleIdentifier:)
@@ -6507,24 +6515,18 @@
   - Selector: "requestAuthorizationOfType:completionHandler:"
     MethodKind: Instance
     SwiftName: "requestAuthorization(to:completionHandler:)"
-  - Selector: "URLForApplicationToOpenContentType:"
-    MethodKind: Instance
-    SwiftName: "urlForApplication(toOpen:)"
-  - Selector: "URLsForApplicationsToOpenContentType:"
+  - Selector: "setDefaultApplicationAtURL:toOpenContentType:completionHandler:"
     MethodKind: Instance
-    SwiftName: "urlsForApplications(toOpen:)"
+    SwiftName: "setDefaultApplication(at:toOpen:completion:)"
   - Selector: "setDefaultApplicationAtURL:toOpenContentTypeOfFileAtURL:completionHandler:"
     MethodKind: Instance
     SwiftName: "setDefaultApplication(at:toOpenContentTypeOfFileAt:completion:)"
-  - Selector: "setDefaultApplicationAtURL:toOpenURLsWithScheme:completionHandler:"
-    MethodKind: Instance
-    SwiftName: "setDefaultApplication(at:toOpenURLsWithScheme:completion:)"
   - Selector: "setDefaultApplicationAtURL:toOpenFileAtURL:completionHandler:"
     MethodKind: Instance
     SwiftName: "setDefaultApplication(at:toOpenFileAt:completion:)"
-  - Selector: "setDefaultApplicationAtURL:toOpenContentType:completionHandler:"
+  - Selector: "setDefaultApplicationAtURL:toOpenURLsWithScheme:completionHandler:"
     MethodKind: Instance
-    SwiftName: "setDefaultApplication(at:toOpen:completion:)"
+    SwiftName: "setDefaultApplication(at:toOpenURLsWithScheme:completion:)"
 - Name: NSWorkspaceAuthorization
   SwiftName: NSWorkspace.Authorization
 - Name: NSWorkspaceOpenConfiguration
@@ -6589,6 +6591,19 @@
   - Selector: "trackMouse:inRect:ofView:untilMouseUp:"
     MethodKind: Instance
     SwiftName: trackMouse(with:in:of:untilMouseUp:)
+- Name: NSTextElementProvider
+  Methods:
+  - Selector: "locationFromLocation:withOffset:"
+    MethodKind: Instance
+    SwiftName: location(_:offsetBy:)
+- Name: NSTextSelectionDataSource
+  Methods:
+  - Selector: "locationFromLocation:withOffset:"
+    MethodKind: Instance
+    SwiftName: location(_:offsetBy:)
+  - Selector: "textRangeForSelectionGranularity:enclosingLocation:"
+    MethodKind: Instance
+    SwiftName: textRange(for:enclosing:)
 - Name: NSToolbarItemValidation
   Methods:
   - Selector: "validateToolbarItem:"
@@ -6958,6 +6973,8 @@
   SwiftName: NSTextBlock.ValueType
 - Name: NSTextBlockVerticalAlignment
   SwiftName: NSTextBlock.VerticalAlignment
+- Name: NSTextContentManagerEnumerationOptions
+  SwiftName: NSTextContentManager.EnumerationOptions
 - Name: NSTextFieldBezelStyle
   SwiftName: NSTextField.BezelStyle
 - Name: NSTextFinderAction
@@ -6984,8 +7001,12 @@
   SwiftName: NSTextSelectionNavigation.Destination
 - Name: NSTextSelectionNavigationDirection
   SwiftName: NSTextSelectionNavigation.Direction
+- Name: NSTextSelectionNavigationLayoutOrientation
+  SwiftName: NSTextSelectionNavigation.LayoutOrientation
 - Name: NSTextSelectionNavigationModifier
   SwiftName: NSTextSelectionNavigation.Modifier
+- Name: NSTextSelectionNavigationWritingDirection
+  SwiftName: NSTextSelectionNavigation.WritingDirection
 - Name: NSTextTabType
   SwiftName: NSParagraphStyle.TextTabType
 - Name: NSTextTableLayoutAlgorithm
@@ -8679,6 +8700,10 @@
   SwiftName: NSApplication.launchIsDefaultUserInfoKey
 - Name: NSApplicationLaunchUserNotificationKey
   SwiftName: NSApplication.launchUserNotificationUserInfoKey
+- Name: NSApplicationProtectedDataDidBecomeAvailableNotification
+  SwiftName: NSApplicationProtectedDataDidBecomeAvailable
+- Name: NSApplicationProtectedDataWillBecomeUnavailableNotification
+  SwiftName: NSApplicationProtectedDataWillBecomeUnavailable
 - Name: NSApplicationWillBecomeActiveNotification
   SwiftName: NSApplication.willBecomeActiveNotification
 - Name: NSApplicationWillFinishLaunchingNotification
@@ -9259,8 +9284,6 @@
   SwiftName: "NSImage.columnViewTemplateName"
 - Name: NSImageNameComputer
   SwiftName: "NSImage.computerName"
-- Name: NSImageNameDotMac NS_DEPRECATED_MAC(10_5, 10_7);
-  SwiftName: "NSImage.dotMacName"
 - Name: NSImageNameEnterFullScreenTemplate
   SwiftName: "NSImage.enterFullScreenTemplateName"
 - Name: NSImageNameEveryone
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h	2021-06-01 21:56:02.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h	2021-06-17 02:06:51.000000000 -0400
@@ -264,7 +264,6 @@
 #import <AppKit/NSTextRange.h>
 #import <AppKit/NSTextSelection.h>
 #import <AppKit/NSTextSelectionNavigation.h>
-#import <AppKit/NSTextTypes.h>
 #import <AppKit/NSTextContentManager.h>
 #import <AppKit/NSTextElement.h>
 #import <AppKit/NSTextLayoutFragment.h>
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSImage.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSImage.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSImage.h	2021-06-02 11:06:48.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSImage.h	2021-06-17 14:33:17.000000000 -0400
@@ -206,6 +206,9 @@
 @property NSImageResizingMode resizingMode API_AVAILABLE(macos(10.10));
 
 - (nullable NSImage *)imageWithSymbolConfiguration:(NSImageSymbolConfiguration *)configuration API_AVAILABLE(macos(11.0));
+
+@property (readonly, copy) NSImageSymbolConfiguration *symbolConfiguration API_AVAILABLE(macos(12.0));
+
 @end
 
 #if !NSIMAGE_UNAVAILABLE_MACCATALYST
@@ -490,12 +493,68 @@
 } NS_SWIFT_NAME(NSImage.SymbolScale) API_AVAILABLE(macos(11.0));
 
 API_AVAILABLE(macos(11.0)) NS_SWIFT_NAME(NSImage.SymbolConfiguration)
-@interface NSImageSymbolConfiguration : NSObject <NSCopying>
-+ (NSImageSymbolConfiguration *)configurationWithPointSize:(CGFloat)pointSize weight:(NSFontWeight)weight scale:(NSImageSymbolScale)scale;
-+ (NSImageSymbolConfiguration *)configurationWithPointSize:(CGFloat)pointSize weight:(NSFontWeight)weight;
-+ (NSImageSymbolConfiguration *)configurationWithTextStyle:(NSFontTextStyle)style scale:(NSImageSymbolScale)scale;
-+ (NSImageSymbolConfiguration *)configurationWithTextStyle:(NSFontTextStyle)style;
-+ (NSImageSymbolConfiguration *)configurationWithScale:(NSImageSymbolScale)scale;
+@interface NSImageSymbolConfiguration : NSObject <NSCopying, NSSecureCoding>
+
++ (instancetype)configurationWithPointSize:(CGFloat)pointSize weight:(NSFontWeight)weight scale:(NSImageSymbolScale)scale;
++ (instancetype)configurationWithPointSize:(CGFloat)pointSize weight:(NSFontWeight)weight;
++ (instancetype)configurationWithTextStyle:(NSFontTextStyle)style scale:(NSImageSymbolScale)scale;
++ (instancetype)configurationWithTextStyle:(NSFontTextStyle)style;
++ (instancetype)configurationWithScale:(NSImageSymbolScale)scale;
+
+/*
+ Create a color configuration with a palette derived from one color.
+
+ A color scheme will be created based on the provided color, deriving
+ secondary and tertiary colors by reducing the intensity of the base color.
+ This is typically (but not only) accomplished by reducing opacity of the
+ primary color.
+
+ When combined with another configuration creating a palette, the
+ last specified configuration will win, overwriting the other color
+ configuration.
+
+ If the symbol doesn't have a palette-based variant, the configuration will
+ have no effect and the result will be a monochrome (templated) symbol.
+ */
++ (instancetype)configurationWithHierarchicalColor:(NSColor *)hierarchicalColor API_AVAILABLE(macos(12.0));
+
+/*
+ Create a color configuration by specifying a palette of colors.
+ The colors are used sequentially per layer: the first color for the first
+ layer, the second color for the second layer etc. This is independent of
+ the hierarchy level of the layer.
+
+ When combined with another configuration creating a palette, the
+ last specified configuration will win, overwriting the other color
+ configuration.
+
+ If the symbol doesn't have a palette-based variant, the configuration will
+ have no effect and the result will be a monochrome (templated) symbol.
+ */
++ (instancetype)configurationWithPaletteColors:(NSArray<NSColor *> *)paletteColors API_AVAILABLE(macos(12.0));
+
+/*
+ Create a configuration that specifies that the symbol should prefer
+ its multicolor variant if one exists.
+
+ This configuration can be combined with one of the palette-based
+ configurations; in that case, the symbol will use the multicolor
+ variant if one exists, or the palette variant otherwise.
+
+ If the symbol supports neither, the result will be a monochrome
+ (templated) symbol.
+ */
++ (instancetype)configurationPreferringMulticolor NS_SWIFT_NAME(preferringMulticolor()) API_AVAILABLE(macos(12.0));
+
+/*
+ Returns a new configuration object whose values are defined by
+ applying values from the provided configuration and the receiver.
+
+ Values defined by both configurations will use the provided
+ configuration's values.
+ */
+- (instancetype)configurationByApplyingConfiguration:(NSImageSymbolConfiguration *)configuration API_AVAILABLE(macos(12.0));
+
 @end
 
 API_UNAVAILABLE_END
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSText.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSText.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSText.h	2021-06-02 11:06:50.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSText.h	2021-06-17 14:33:19.000000000 -0400
@@ -9,13 +9,40 @@
 #import <AppKit/NSView.h>
 #import <AppKit/NSSpellProtocol.h>
 #import <AppKit/AppKitDefines.h>
-#import <AppKit/NSTextTypes.h>
 
 @class NSColor, NSFont, NSNotification;
 @protocol NSTextDelegate;
 
 NS_ASSUME_NONNULL_BEGIN
 
+#if !TARGET_OS_IPHONE
+
+#if !__NSTEXT_SHARED_SECTION__
+#define __NSTEXT_SHARED_SECTION__ 1
+#pragma mark NSTextAlignment
+typedef NS_ENUM(NSInteger, NSTextAlignment) {
+    NSTextAlignmentLeft      = 0,    // Visually left aligned
+#if TARGET_ABI_USES_IOS_VALUES
+    NSTextAlignmentCenter    = 1,    // Visually centered
+    NSTextAlignmentRight     = 2,    // Visually right aligned
+#else /* !TARGET_ABI_USES_IOS_VALUES */
+    NSTextAlignmentRight     = 1,    // Visually right aligned
+    NSTextAlignmentCenter    = 2,    // Visually centered
+#endif
+    NSTextAlignmentJustified = 3,    // Fully-justified. The last line in a paragraph is natural-aligned.
+    NSTextAlignmentNatural   = 4     // Indicates the default alignment for script
+} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
+
+#pragma mark NSWritingDirection
+typedef NS_ENUM(NSInteger, NSWritingDirection) {
+    NSWritingDirectionNatural       = -1,   // Determines direction using the Unicode Bidi Algorithm rules P2 and P3
+    NSWritingDirectionLeftToRight   = 0,    // Left to right writing direction
+    NSWritingDirectionRightToLeft   = 1     // Right to left writing direction
+} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
+#endif // __NSTEXT_SHARED_SECTION__
+
+#endif // !TARGET_OS_IPHONE
+
 APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 @interface NSText : NSView <NSChangeSpelling, NSIgnoreMisspelledWords>
 
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextContentManager.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextContentManager.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextContentManager.h	2021-06-02 11:06:51.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextContentManager.h	2021-06-17 14:33:20.000000000 -0400
@@ -26,9 +26,9 @@
 NS_ASSUME_NONNULL_BEGIN
 
 #pragma mark NSTextElementProvider
-typedef NS_OPTIONS(NSUInteger, NSTextElementProviderEnumerationOptions) {
-  NSTextElementProviderEnumerationOptionsNone = 0,
-  NSTextElementProviderEnumerationOptionsReverse = (1 << 0)
+typedef NS_OPTIONS(NSUInteger, NSTextContentManagerEnumerationOptions) {
+    NSTextContentManagerEnumerationOptionsNone = 0,
+    NSTextContentManagerEnumerationOptionsReverse = (1 << 0)
 } API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.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.
@@ -38,7 +38,7 @@
 @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.
-- (nullable id <NSTextLocation>)enumerateTextElementsFromLocation:(nullable id <NSTextLocation>)textLocation options:(NSTextElementProviderEnumerationOptions)options usingBlock:(BOOL (NS_NOESCAPE ^)(NSTextElement *element))block;
+- (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.
 - (void)replaceContentsInRange:(NSTextRange *)range withTextElements:(nullable NSArray<NSTextElement *> *)textElements;
@@ -46,15 +46,15 @@
 //  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.
 - (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).
 - (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).
 - (NSInteger)offsetFromLocation:(id <NSTextLocation>)from toLocation:(id <NSTextLocation>)to;
 
-@optional
-// 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. inEditingTextSelection indicates if textRange is for the text selection associated with the edit session.
-- (nullable NSTextRange *)adjustedRangeFromRange:(NSTextRange *)textRange inEditingTextSelection:(BOOL)inEditingTextSelection;
+// 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.
+- (nullable NSTextRange *)adjustedRangeFromRange:(NSTextRange *)textRange forEditingTextSelection:(BOOL)forEditingTextSelection;
 @end
 
 #pragma mark NSTextContentManager
@@ -90,16 +90,16 @@
 @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.
-- (void)performEditingTransactionWithBlock:(void (NS_NOESCAPE ^) (void))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.
 - (void)recordEditActionInRange:(NSTextRange *)originalTextRange newTextRange:(NSTextRange *)newTextRange;
 
 // Automatically synchronizes all text layout managers when hasEditingTransaction becoming NO. YES by default.
-@property BOOL synchronizesTextLayoutManagersAutomatically;
+@property BOOL automaticallySynchronizesTextLayoutManagers;
 
 // Automatically synchronizes the backing store when hasEditingTransaction becoming NO. NO by default.
-@property BOOL synchronizesToBackingStoreAutomatically;
+@property BOOL automaticallySynchronizesToBackingStore;
 @end
 
 #pragma mark NSTextContentManagerDelegate
@@ -110,7 +110,7 @@
 - (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.
-- (BOOL)textContentManager:(NSTextContentManager *)textContentManager shouldEnumerateTextElement:(NSTextElement *)textElement withOptions:(NSTextElementProviderEnumerationOptions)options;
+- (BOOL)textContentManager:(NSTextContentManager *)textContentManager shouldEnumerateTextElement:(NSTextElement *)textElement options:(NSTextContentManagerEnumerationOptions)options;
 @end
 
 #pragma mark NSTextContentStorageDelegate
@@ -118,7 +118,7 @@
 @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.
-- (nullable NSTextParagraph *)textContentStorage:(NSTextContentStorage *)textContentManager textParagraphWithRange:(NSRange)range;
+- (nullable NSTextParagraph *)textContentStorage:(NSTextContentStorage *)textContentStorage textParagraphWithRange:(NSRange)range;
 @end
 
 #pragma mark NSTextContentStorage
@@ -138,6 +138,16 @@
 
 // Returns NSTextElement corresponding to attributedString. Returns nil when attributedString contains attributes not mappable to NSTextElement.
 - (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).
+- (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).
+- (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.
+- (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.
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextElement.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextElement.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextElement.h	2021-06-02 11:06:40.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextElement.h	2021-06-17 14:33:09.000000000 -0400
@@ -39,7 +39,7 @@
 - (instancetype)initWithAttributedString:(nullable NSAttributedString *)attributedString NS_DESIGNATED_INITIALIZER;
 
 #pragma mark Contents
-@property (copy, readonly) NSAttributedString *attributedString;
+@property (strong, readonly) NSAttributedString *attributedString;
 
 // The paragraph ranges are derived from elementRange and attributedString.
 @property (nullable, strong, readonly) NSTextRange *paragraphContentRange;
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLayoutFragment.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLayoutFragment.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLayoutFragment.h	2021-06-02 11:06:41.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLayoutFragment.h	2021-06-17 14:33:10.000000000 -0400
@@ -78,10 +78,23 @@
 // The bounds defining the area required for rendering the contents. The coordinate system is vertically flipped from the layoutFragmentFrame 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.
 @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.
+@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).
+@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.
+@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.
+@property (readonly) CGFloat bottomMargin;
+
 #pragma mark Rendering
 // Renders the visual representation of this element in the specified graphics context.
-- (void)drawAtPoint:(CGPoint)renderingOrigin inContext:(CGContextRef)ctx;
-
+- (void)drawAtPoint:(CGPoint)point inContext:(CGContextRef)context;
 @end
 NS_ASSUME_NONNULL_END
 #endif // !TARGET_OS_IPHONE
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLayoutManager.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLayoutManager.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLayoutManager.h	2021-06-02 11:06:39.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLayoutManager.h	2021-06-17 14:33:08.000000000 -0400
@@ -98,7 +98,7 @@
 - (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.
-- (nullable id <NSTextLocation>)enumerateTextLayoutFragmentsFromLocation:(nullable id <NSTextLocation>)location options:(NSTextLayoutFragmentEnumerationOptions)options usingBlock:(BOOL (^)(NSTextLayoutFragment *layoutFragment))block;
+- (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.
@@ -148,10 +148,6 @@
 API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
 @protocol NSTextLayoutManagerDelegate <NSObject>
 @optional
-// NSTextContainer management
-// Returns the next text container that will be added to textContainers. If this method returns nil, templateTextContainer will be consulted next.
-- (NSTextContainer *)textLayoutManager:(NSTextLayoutManager *)textLayoutManager textContainerForLocation:(id <NSTextLocation>)location;
-
 // NSTextLayoutFragment management
 // Returns NSTextLayoutFragment for location in textElement. NSTextLayoutManagerDelegate could provide an NSTextLayoutFragment specialized for an NSTextElement subclass targeted for the rendering surface.
 - (NSTextLayoutFragment *)textLayoutManager:(NSTextLayoutManager *)textLayoutManager textLayoutFragmentForLocation:(id <NSTextLocation>)location inTextElement:(NSTextElement *)textElement;
@@ -163,6 +159,7 @@
 // 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.
 - (nullable NSDictionary<NSAttributedStringKey, id> *)textLayoutManager:(NSTextLayoutManager *)textLayoutManager renderingAttributesForLink:(id)link atLocation:(id <NSTextLocation>)location defaultAttributes:(NSDictionary<NSAttributedStringKey, id> *)renderingAttributes;
+
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLineFragment.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLineFragment.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLineFragment.h	2021-06-02 11:06:46.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextLineFragment.h	2021-06-17 14:33:15.000000000 -0400
@@ -29,7 +29,7 @@
 
 #pragma mark Basic properties
 // The source attributed string
-@property (readonly, copy) NSAttributedString *attributedString;
+@property (strong, readonly) NSAttributedString *attributedString;
 
 // The string range for the source attributed string corresponding to this line fragment
 @property (readonly) NSRange characterRange;
@@ -50,10 +50,10 @@
 - (CGPoint)locationForCharacterAtIndex:(NSInteger)index;
 
 // The character index for point inside the line fragment coordinate system. The fraction of distance is from the upstream edge
-- (NSInteger)characterIndexForPoint:(CGPoint)point fractionOfDistanceThroughGlyph:(nullable CGFloat *)partialFraction;
+- (NSInteger)characterIndexForPoint:(CGPoint)point;
+- (CGFloat)fractionOfDistanceThroughGlyphForPoint:(CGPoint)point;
 
 @end
-
 NS_ASSUME_NONNULL_END
 #endif // !TARGET_OS_IPHONE
 #else
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextRange.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextRange.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextRange.h	2021-06-02 11:06:40.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextRange.h	2021-06-17 14:33:08.000000000 -0400
@@ -50,7 +50,7 @@
 - (BOOL)intersectsWithTextRange:(NSTextRange *)textRange;
 
 #pragma mark Basic mutations
-// Returns nil when two ranges are not intersecting
+// Returns the intersection with textRange. Returns nil when not intersecting.
 - (nullable instancetype)textRangeByIntersectingWithTextRange:(NSTextRange *)textRange;
 - (instancetype)textRangeByFormingUnionWithTextRange:(NSTextRange *)textRange;
 @end
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextSelection.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextSelection.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextSelection.h	2021-06-02 11:06:46.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextSelection.h	2021-06-17 14:33:15.000000000 -0400
@@ -21,16 +21,16 @@
 #pragma mark NSTextSelection
 
 typedef NS_ENUM(NSInteger, NSTextSelectionGranularity) {
-    NSTextSelectionGranularityCharacter,
-    NSTextSelectionGranularityWord,
-    NSTextSelectionGranularityParagraph,
-    NSTextSelectionGranularityLine,
-    NSTextSelectionGranularitySentence
+  NSTextSelectionGranularityCharacter,
+  NSTextSelectionGranularityWord,
+  NSTextSelectionGranularityParagraph,
+  NSTextSelectionGranularityLine,
+  NSTextSelectionGranularitySentence
 } API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
 
 typedef NS_ENUM(NSInteger, NSTextSelectionAffinity) {
-    NSTextSelectionAffinityUpstream = 0,
-    NSTextSelectionAffinityDownstream = 1
+  NSTextSelectionAffinityUpstream = 0,
+  NSTextSelectionAffinityDownstream = 1
 } API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
 
 API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@@ -75,8 +75,9 @@
 @property (copy) NSDictionary<NSAttributedStringKey, id> *typingAttributes;
 
 #pragma mark Selection manipulation
-// Returns a selection with textRanges. Copying properties appropriate for the new instance.
+// Returns a copy of this selection, replacing this instance's textRanges property with textRanges but keeping all other attributes the same.
 - (NSTextSelection *)textSelectionWithTextRanges:(NSArray<NSTextRange *> *)textRanges;
+
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextSelectionNavigation.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextSelectionNavigation.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextSelectionNavigation.h	2021-06-02 11:06:40.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextSelectionNavigation.h	2021-06-17 14:33:09.000000000 -0400
@@ -11,7 +11,6 @@
 
 #import <Foundation/NSObject.h>
 #import <CoreGraphics/CGGeometry.h>
-#import <AppKit/NSTextTypes.h>
 #import <AppKit/NSTextSelection.h>
 
 NS_ASSUME_NONNULL_BEGIN
@@ -29,7 +28,7 @@
     // Works with just character information
     NSTextSelectionNavigationDirectionForward,
     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
     NSTextSelectionNavigationDirectionRight,
@@ -54,10 +53,22 @@
     NSTextSelectionNavigationModifierMultiple = (1 << 2), // Extends the selection visually inside the rectangular area defined by the anchor and dragged positions and produces an NSTextSelection per line
 } API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
 
+typedef NS_ENUM(NSInteger, NSTextSelectionNavigationWritingDirection) {
+    NSTextSelectionNavigationWritingDirectionLeftToRight   = 0,    // Left to right writing direction
+    NSTextSelectionNavigationWritingDirectionRightToLeft   = 1     // Right to left writing direction
+} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
+
+typedef NS_ENUM(NSInteger, NSTextSelectionNavigationLayoutOrientation) {
+    NSTextSelectionNavigationLayoutOrientationHorizontal = 0, // Lines rendered horizontally, grow top to bottom
+    NSTextSelectionNavigationLayoutOrientationVertical = 1, // Lines rendered vertically, grow right to left
+} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
+
 API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
 @interface NSTextSelectionNavigation : NSObject
 #pragma mark Initialization
 - (instancetype)initWithDataSource:(id <NSTextSelectionDataSource>)dataSource NS_DESIGNATED_INITIALIZER;
+
++ (instancetype)new NS_UNAVAILABLE;
 - (instancetype)init NS_UNAVAILABLE;
 
 #pragma mark Properties
@@ -84,11 +95,12 @@
 // Returns a text selection expanded to the nearest boundaries for selectionGranularity enclosing textSelection.textRanges. The returned selection will have granularity=selectionGranularity.
 - (NSTextSelection *)textSelectionForSelectionGranularity:(NSTextSelectionGranularity)selectionGranularity enclosingTextSelection:(NSTextSelection *)textSelection;
 
-- (nullable NSTextSelection *)textSelectionForSelectionGranularity:(NSTextSelectionGranularity)granularity enclosingPoint:(CGPoint)point inContainerAtLocation:(id <NSTextLocation>)containerLocation;
+// 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.
+- (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.
-- (nullable id <NSTextLocation>)resolvedInsertionPointForTextSelection:(NSTextSelection *)textSelection writingDirection:(NSWritingDirection)writingDirection;
+- (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.
 - (NSArray<NSTextRange *> *)deletionRangesForTextSelection:(NSTextSelection *)textSelection direction:(NSTextSelectionNavigationDirection)direction destination:(NSTextSelectionNavigationDestination)destination allowsDecomposition:(BOOL)allowsDecomposition;
@@ -101,7 +113,7 @@
 @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.
-- (void)enumerateSubstringsFromLocation:(id <NSTextLocation>)location options:(NSStringEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSString * _Nullable substring, NSTextRange *substringRange, NSTextRange * _Nullable enclosingRange, BOOL *stop))block;
+- (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.
 - (nullable NSTextRange *)textRangeForSelectionGranularity:(NSTextSelectionGranularity)selectionGranularity enclosingLocation:(id <NSTextLocation>)location;
@@ -112,8 +124,8 @@
 // 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).
 - (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 NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft.
-- (NSWritingDirection)baseWritingDirectionAtLocation:(id <NSTextLocation>)location;
+// Returns the base writing direction at location. It is recommended to return 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.
@@ -124,10 +136,10 @@
 
 @optional
 // This optional method should be implemented enumerating the text container/page boundary when the text selection data provider supports such a layout functionality.
-- (void)enumerateContainerBoundariesFromLocation:(id <NSTextLocation>)location reverse:(BOOL)isBackward usingBlock:(void (NS_NOESCAPE ^)(id <NSTextLocation> boundaryLocation, BOOL *stop))block;
+- (void)enumerateContainerBoundariesFromLocation:(id <NSTextLocation>)location reverse:(BOOL)reverse usingBlock:(void (NS_NOESCAPE ^)(id <NSTextLocation> boundaryLocation, BOOL *stop))block;
 
-// Returns the text writing mode at location. If not implemented, NSTextSelectionNavigation assumes it is NSTextWritingModeHorizontal.
-- (NSTextWritingMode)textWritingModeAtLocation:(id <NSTextLocation>)location;
+// Returns the text layout orientation at location. If not implemented, NSTextSelectionNavigation assumes it is NSTextSelectionNavigationLayoutOrientationHorizontal.
+- (NSTextSelectionNavigationLayoutOrientation)textLayoutOrientationAtLocation:(id <NSTextLocation>)location;
 @end
 NS_ASSUME_NONNULL_END
 #endif // !TARGET_OS_IPHONE
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextStorage.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextStorage.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextStorage.h	2021-06-02 11:06:40.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextStorage.h	2021-06-17 14:33:09.000000000 -0400
@@ -121,7 +121,7 @@
 - (void)processEditingForTextStorage:(NSTextStorage *)textStorage edited:(NSTextStorageEditActions)editMask range:(NSRange)newCharRange changeInLength:(NSInteger)delta invalidatedRange:(NSRange)invalidatedCharRange;
 
 // Transactional editing support
-- (void)performEditingTransactionForTextStorage:(NSTextStorage *)textStorage withBlock:(void (NS_NOESCAPE ^) (void))transaction;
+- (void)performEditingTransactionForTextStorage:(NSTextStorage *)textStorage usingBlock:(void (NS_NOESCAPE ^) (void))transaction;
 @end
 
 /**** Deprecations ****/
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextTypes.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextTypes.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextTypes.h	2021-06-02 11:06:41.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextTypes.h	1969-12-31 19:00:00.000000000 -0500
@@ -1,56 +0,0 @@
-#if (defined(USE_APPKIT_PUBLIC_HEADERS) && USE_APPKIT_PUBLIC_HEADERS) || !__has_include(<UIFoundation/NSTextTypes.h>)
-#include <TargetConditionals.h>
-
-#if !TARGET_OS_IPHONE
-//
-//  NSTextTypes.h
-//  Text Kit
-//
-//  Copyright (c) 2021, Apple Inc. All rights reserved.
-//
-
-
-#import <Foundation/NSObject.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-#if !__NSTEXT_SHARED_SECTION__
-#define __NSTEXT_SHARED_SECTION__ 1
-#pragma mark NSTextAlignment
-typedef NS_ENUM(NSInteger, NSTextAlignment) {
-    NSTextAlignmentLeft      = 0,    // Visually left aligned
-#if TARGET_ABI_USES_IOS_VALUES
-    NSTextAlignmentCenter    = 1,    // Visually centered
-    NSTextAlignmentRight     = 2,    // Visually right aligned
-#else /* !TARGET_ABI_USES_IOS_VALUES */
-    NSTextAlignmentRight     = 1,    // Visually right aligned
-    NSTextAlignmentCenter    = 2,    // Visually centered
-#endif
-    NSTextAlignmentJustified = 3,    // Fully-justified. The last line in a paragraph is natural-aligned.
-    NSTextAlignmentNatural   = 4     // Indicates the default alignment for script
-} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
-
-#pragma mark NSWritingDirection
-typedef NS_ENUM(NSInteger, NSWritingDirection) {
-    NSWritingDirectionNatural       = -1,   // Determines direction using the Unicode Bidi Algorithm rules P2 and P3
-    NSWritingDirectionLeftToRight   = 0,    // Left to right writing direction
-    NSWritingDirectionRightToLeft   = 1     // Right to left writing direction
-} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
-#endif // __NSTEXT_SHARED_SECTION__
-
-#pragma mark NSTextWritingMode
-typedef NS_ENUM(NSInteger, NSTextWritingMode) {
-    NSTextWritingModeHorizontal = 0, // Lines rendered horizontally, grow top to bottom
-    NSTextWritingModeVertical = 1, // Lines rendered vertically, grow right to left
-} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
-
-@protocol NSTextWritingModeProvider <NSObject>
-// A property describing the receiver's writing mode.  This property defines the default value for the range of string laid out in the receiver in absence of explicit NSVerticalGlyphFormAttributeName attribute.  For example, when NSTextWritingModeVertical, the default value for NSVerticalGlyphFormAttributeName is 1.  When rendering into the receiver, the Text System assumes the coordinate system is appropriately rotated.
-@property (readonly) NSTextWritingMode textWritingMode API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
-@end
-
-NS_ASSUME_NONNULL_END
-#endif // !TARGET_OS_IPHONE
-#else
-#import <UIFoundation/NSTextTypes.h>
-#endif
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextViewportLayoutController.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextViewportLayoutController.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextViewportLayoutController.h	2021-06-02 11:06:51.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSTextViewportLayoutController.h	2021-06-17 14:33:20.000000000 -0400
@@ -2,12 +2,12 @@
 #include <TargetConditionals.h>
 
 #if !TARGET_OS_IPHONE
-/*
-    NSTextViewportLayoutController.h
-    Text Kit
-    Copyright (c) 2017-2021, Apple Inc.
-    All rights reserved.
-*/
+//
+//  NSTextViewportLayoutController.h
+//  Text Kit
+//
+//  Copyright (c) 2017-2021, Apple Inc. All rights reserved.
+//
 
 #import <Foundation/NSObject.h>
 #import <CoreGraphics/CGGeometry.h>
@@ -25,11 +25,11 @@
 #pragma mark NSTextViewportLayoutControllerDelegate
 API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
 @protocol NSTextViewportLayoutControllerDelegate <NSObject>
-
-#pragma mark Viewport layout
+#pragma mark Properties
 // The current viewport, typically the view visible bounds with overdraw.
 - (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.
@@ -52,13 +52,15 @@
 @interface NSTextViewportLayoutController : NSObject
 #pragma mark Initialization
 - (instancetype)initWithTextLayoutManager:(NSTextLayoutManager *)textLayoutManager NS_DESIGNATED_INITIALIZER;
+
++ (instancetype)new NS_UNAVAILABLE;
 - (instancetype)init NS_UNAVAILABLE;
 
 #pragma mark Properties
 // The viewport layout delegate.
 @property (nullable, weak) id <NSTextViewportLayoutControllerDelegate> delegate;
 
-// The provider of layout fragments.
+// The provider of viewport text layout fragments.
 @property (weak, readonly) NSTextLayoutManager *textLayoutManager;
 
 #pragma mark Viewport layout state
@@ -77,12 +79,11 @@
 // 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.
-- (CGFloat)relocateViewport:(id<NSTextLocation>)location;
+- (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.
-- (void)adjustViewport:(CGFloat)verticalOffset;
-
+- (void)adjustViewportByVerticalOffset:(CGFloat)verticalOffset;
 @end
 NS_ASSUME_NONNULL_END
 #endif // !TARGET_OS_IPHONE
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSToolbar.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSToolbar.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSToolbar.h	2021-06-02 11:06:39.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSToolbar.h	2021-06-17 14:33:08.000000000 -0400
@@ -135,7 +135,7 @@
 
     /* Notifications */
 
-/* Before an new item is added to the toolbar, this notification is posted.  This is the best place to notice a new item is going into the toolbar.  For instance, if you need to cache a reference to the toolbar item or need to set up some initial state, this is the best place to do it.   The notification object is the toolbar to which the item is being added.  The item being added is found by referencing the @"item" key in the userInfo.  */
+/* Before a new item is added to the toolbar, this notification is posted.  This is the best place to notice a new item is going into the toolbar.  For instance, if you need to cache a reference to the toolbar item or need to set up some initial state, this is the best place to do it.   The notification object is the toolbar to which the item is being added.  The item being added is found by referencing the @"item" key in the userInfo.  */
 - (void)toolbarWillAddItem:(NSNotification *)notification;
 
 /* After an item is removed from a toolbar the notification is sent.  This allows the chance to tear down information related to the item that may have been cached.  The notification object is the toolbar from which the item is being removed.  The item being removed is found by referencing the @"item" key in the userInfo.  */
diff -ruN /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSToolbarItem.h /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSToolbarItem.h
--- /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSToolbarItem.h	2021-06-02 11:06:42.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSToolbarItem.h	2021-06-17 14:33:11.000000000 -0400
@@ -87,7 +87,7 @@
  */
 @property (getter=isNavigational) BOOL navigational API_AVAILABLE(macos(11.0), ios(14.0));
 
-/* Use setView: if you want your toolbar item to use something other than the standard.  Note that, by default, many of the set/get methods will be implemented by calls forwarded to the view you set, if it responds to it.  Also, your view must be archivable (in order for the toolbar to make copies of your item to hand off to the config palette). */
+/* Use setView: if you want your toolbar item to use something other than the standard.  Note that, by default, many of the set/get methods will be implemented by calls forwarded to the view you set, if it responds to it. */
 @property (nullable, strong) NSView *view API_UNAVAILABLE(ios);
 
 /*
Clone this wiki locally