-
Notifications
You must be signed in to change notification settings - Fork 514
Foundation tvOS xcode15.3 b1
Alex Soto edited this page May 22, 2024
·
2 revisions
#Foundation.framework https://github.com/xamarin/xamarin-macios/pull/20097
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h 2023-11-12 10:35:53
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h 2024-01-18 01:11:44
@@ -57,23 +57,24 @@
NSCalendarUnitNanosecond API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)) = (1 << 15),
NSCalendarUnitCalendar API_AVAILABLE(macos(10.7), ios(4.0), watchos(2.0), tvos(9.0)) = (1 << 20),
NSCalendarUnitTimeZone API_AVAILABLE(macos(10.7), ios(4.0), watchos(2.0), tvos(9.0)) = (1 << 21),
-
- NSEraCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitEra", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitEra,
- NSYearCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitYear", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitYear,
- NSMonthCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitMonth", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitMonth,
- NSDayCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitDay", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitDay,
- NSHourCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitHour", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitHour,
- NSMinuteCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitMinute", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitMinute,
- NSSecondCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitSecond", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitSecond,
- NSWeekCalendarUnit API_DEPRECATED("NSCalendarUnitWeekOfMonth or NSCalendarUnitWeekOfYear, depending on which you mean", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = kCFCalendarUnitWeek,
- NSWeekdayCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitWeekday", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitWeekday,
- NSWeekdayOrdinalCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitWeekdayOrdinal", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitWeekdayOrdinal,
- NSQuarterCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitQuarter", macos(10.6, 10.10), ios(4.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitQuarter,
- NSWeekOfMonthCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitWeekOfMonth", macos(10.7, 10.10), ios(5.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitWeekOfMonth,
- NSWeekOfYearCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitWeekOfYear", macos(10.7, 10.10), ios(5.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitWeekOfYear,
- NSYearForWeekOfYearCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitYearForWeekOfYear", macos(10.7, 10.10), ios(5.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitYearForWeekOfYear,
- NSCalendarCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitCalendar", macos(10.7, 10.10), ios(4.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitCalendar,
- NSTimeZoneCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitTimeZone", macos(10.7, 10.10), ios(4.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitTimeZone,
+ #if !0
+ NSEraCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitEra", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitEra,
+ NSYearCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitYear", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitYear,
+ NSMonthCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitMonth", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitMonth,
+ NSDayCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitDay", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitDay,
+ NSHourCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitHour", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitHour,
+ NSMinuteCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitMinute", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitMinute,
+ NSSecondCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitSecond", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitSecond,
+ NSWeekCalendarUnit API_DEPRECATED("NSCalendarUnitWeekOfMonth or NSCalendarUnitWeekOfYear, depending on which you mean", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = kCFCalendarUnitWeek,
+ NSWeekdayCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitWeekday", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitWeekday,
+ NSWeekdayOrdinalCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitWeekdayOrdinal", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitWeekdayOrdinal,
+ NSQuarterCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitQuarter", macos(10.6, 10.10), ios(4.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitQuarter,
+ NSWeekOfMonthCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitWeekOfMonth", macos(10.7, 10.10), ios(5.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitWeekOfMonth,
+ NSWeekOfYearCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitWeekOfYear", macos(10.7, 10.10), ios(5.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitWeekOfYear,
+ NSYearForWeekOfYearCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitYearForWeekOfYear", macos(10.7, 10.10), ios(5.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitYearForWeekOfYear,
+ NSCalendarCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitCalendar", macos(10.7, 10.10), ios(4.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitCalendar,
+ NSTimeZoneCalendarUnit API_DEPRECATED_WITH_REPLACEMENT("NSCalendarUnitTimeZone", macos(10.7, 10.10), ios(4.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarUnitTimeZone,
+ #endif
};
typedef NS_OPTIONS(NSUInteger, NSCalendarOptions) {
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDecimalNumber.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDecimalNumber.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDecimalNumber.h 2023-11-12 02:50:35
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSDecimalNumber.h 2024-01-12 00:22:54
@@ -44,9 +44,7 @@
unsigned int _reserved:1;
unsigned int _hasExternalRefCount:1;
unsigned int _refs:16;
-
- unsigned short _mantissa[0]; /* GCC */
-
+ unsigned short _mantissa[];
}
- (instancetype)initWithMantissa:(unsigned long long)mantissa exponent:(short)exponent isNegative:(BOOL)flag;
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFilePresenter.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFilePresenter.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFilePresenter.h 2023-10-28 17:08:33
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFilePresenter.h 2024-01-12 23:02:26
@@ -67,6 +67,12 @@
*/
- (void)accommodatePresentedItemDeletionWithCompletionHandler:(void (NS_SWIFT_SENDABLE ^)(NSError * _Nullable errorOrNil))completionHandler;
+/* Given that something in the system is waiting to evict the presented file or directory, do whatever it takes to ensure that the eviction will succeed and that the receiver's application will behave properly when the eviction has happened, and then invoke the completion handler. This must include calling `+[NSFileCoordinator removeFilePresenter:]`. If successful, pass nil to the completion handler. If not successful, or to prevent the eviction of the file, throw an error that encapsulates the reason. Implementations of this method must always invoke the completion handler because other parts of the system will wait until it is invoked or until the user loses patience and cancels the waiting.
+
+If this method is not implemented, eviction will fail.
+*/
+- (void)accommodatePresentedItemEvictionWithCompletionHandler:(void (NS_SWIFT_SENDABLE ^)(NSError * _Nullable errorOrNil))completionHandler API_AVAILABLE(macos(14.4), ios(17.4)) API_UNAVAILABLE(watchos, tvos);
+
/* Be notified that the file or directory has been moved or renamed, or a directory containing it has been moved or renamed. A typical implementation of this method will cause subsequent invocations of -presentedItemURL to return the new URL.
The new URL may have a different file name extension than the current value of the presentedItemURL property.
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h 2023-10-28 17:08:32
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h 2024-01-12 00:22:52
@@ -140,14 +140,12 @@
- (NSComparisonResult)compare:(NSString *)string options:(NSStringCompareOptions)mask range:(NSRange)rangeOfReceiverToCompare;
- (NSComparisonResult)compare:(NSString *)string options:(NSStringCompareOptions)mask range:(NSRange)rangeOfReceiverToCompare locale:(nullable id)locale; // locale arg used to be a dictionary pre-Leopard. We now accept NSLocale. Assumes the current locale if non-nil and non-NSLocale. nil continues to mean canonical compare, which doesn't depend on user's locale choice.
- (NSComparisonResult)caseInsensitiveCompare:(NSString *)string;
-#if !0
- (NSComparisonResult)localizedCompare:(NSString *)string;
- (NSComparisonResult)localizedCaseInsensitiveCompare:(NSString *)string;
/* localizedStandardCompare:, added in 10.6, should be used whenever file names or other strings are presented in lists and tables where Finder-like sorting is appropriate. The exact behavior of this method may be tweaked in future releases, and will be different under different localizations, so clients should not depend on the exact sorting order of the strings.
*/
- (NSComparisonResult)localizedStandardCompare:(NSString *)string API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
-#endif
- (BOOL)isEqualToString:(NSString *)aString;
@@ -502,9 +500,7 @@
FOUNDATION_EXPORT NSExceptionName const NSCharacterConversionException;
-#if !0
FOUNDATION_EXPORT NSExceptionName const NSParseErrorException; // raised by -propertyList
-#endif
#define NSMaximumStringLength (INT_MAX-1)
#pragma mark *** Deprecated/discouraged APIs ***
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h 2023-11-12 02:50:36
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h 2024-01-12 23:02:27
@@ -643,13 +643,11 @@
@interface NSString (NSURLUtilities)
-#if !0
// Returns a new string made from the receiver by replacing all characters not in the allowedCharacters set with percent encoded characters. UTF-8 encoding is used to determine the correct percent encoded characters. Entire URL strings cannot be percent-encoded. This method is intended to percent-encode a URL component or subcomponent string, NOT the entire URL string. Any characters in allowedCharacters outside of the 7-bit ASCII range are ignored.
- (nullable NSString *)stringByAddingPercentEncodingWithAllowedCharacters:(NSCharacterSet *)allowedCharacters API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
// Returns a new string made from the receiver by replacing all percent encoded sequences with the matching UTF-8 characters.
@property (nullable, readonly, copy) NSString *stringByRemovingPercentEncoding API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
-#endif
- (nullable NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)enc API_DEPRECATED("Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid.", macos(10.0,10.11), ios(2.0,9.0), watchos(2.0,2.0), tvos(9.0,9.0));
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h 2023-11-12 02:47:01
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h 2024-01-11 20:15:51
@@ -2,7 +2,6 @@
Copyright (c) 1995-2019, Apple Inc. All rights reserved.
*/
-
//
// NSUndoManager is a general-purpose undo stack where clients can register
// callbacks to be invoked should an undo be requested.
@@ -24,124 +23,219 @@
API_AVAILABLE(macos(10.0), ios(3.0), watchos(2.0), tvos(9.0))
@interface NSUndoManager : NSObject
- /* Begin/End Grouping */
-
+/// Marks the beginning of an undo group.
+///
+/// All individual undo operations before a subsequent ``endUndoGrouping`` message are grouped together and reversed by a later ``undo`` message. By default undo groups are begun automatically at the start of the event loop, but you can begin your own undo groups with this method, and nest them within other groups.
+///
+/// This method posts an ``NSUndoManagerCheckpointNotification`` unless a top-level undo is in progress. It posts an ``NSUndoManagerDidOpenUndoGroupNotification`` if a new group was successfully created.
- (void)beginUndoGrouping;
+
+/// Marks the end of an undo group.
+///
+/// All individual undo operations back to the matching ``beginUndoGrouping`` message are grouped together and reversed by a later ``undo`` or ``undoNestedGroup`` message. Undo groups can be nested, thus providing functionality similar to nested transactions. Raises an ``NSInternalInconsistencyException`` if there’s no ``beginUndoGrouping`` message in effect.
+///
+/// This method posts an ``NSUndoManagerCheckpointNotification`` and an ``NSUndoManagerDidCloseUndoGroupNotification`` just before the group is closed.
- (void)endUndoGrouping;
- // These nest.
+/// The number of nested undo groups (or redo groups, if Redo was invoked last) in the current event loop.
+///
+/// An integer indicating the number of nested groups. If `0` is returned, there is no open undo or redo group.
@property (readonly) NSInteger groupingLevel;
- // Zero means no open group.
- /* Enable/Disable registration */
-
+/// Disables the recording of undo operations, whether by ``registerUndoWithTarget:selector:object:`` or by invocation-based undo.
+///
+/// This method can be invoked multiple times by multiple clients. The ``enableUndoRegistration`` method must be invoked an equal number of times to re-enable undo registration.
- (void)disableUndoRegistration;
+
+/// Enables the recording of undo operations.
+///
+/// Because undo registration is enabled by default, this is used to balance a prior ``disableUndoRegistration``. Undo registration isn’t actually re-enabled until an enable message balances the last disable message in effect.
+/// Raises an NSInternalInconsistencyException if invoked while no disableUndoRegistration() message is in effect.
- (void)enableUndoRegistration;
+
+/// Whether the recording of undo operations is enabled.
@property (readonly, getter=isUndoRegistrationEnabled) BOOL undoRegistrationEnabled;
- /* Groups By Event */
-
+/// A Boolean value that indicates whether the receiver automatically creates undo groups around each pass of the run loop.
+///
+/// If `true`, the receiver automatically creates undo groups around each pass of the run loop.
+/// The default is `true`. If you turn automatic grouping off, you must close groups explicitly before invoking either ``undo`` or ``undoNestedGroup``.
@property BOOL groupsByEvent;
- // If groupsByEvent is enabled, the undoManager automatically groups
- // all undos registered during a single NSRunLoop event together in
- // a single top-level group. This featured is enabled by default.
- /* Undo levels */
+/// The maximum number of top-level undo groups the receiver holds.
+///
+/// An integer specifying the number of undo groups. A limit of 0 indicates no limit, so old undo groups are never dropped.
+/// When ending an undo group results in the number of groups exceeding this limit, the oldest groups are dropped from the stack. The default is 0.
+/// If you change the limit to a level below the prior limit, old undo groups are immediately dropped.
@property NSUInteger levelsOfUndo;
- // Sets the number of complete groups (not operations) that should
- // be kept my the manager. When limit is reached, oldest undos are
- // thrown away. 0 means no limit !
- /* Run Loop Modes */
-
+/// The modes governing the types of input handled during a cycle of the run loop.
+///
+/// An array of string constants specifying the current run-loop modes.
+/// By default, the sole run-loop mode is ``NSDefaultRunLoopMode`` (which excludes data from ``NSConnection`` objects). Some examples of other uses are to limit the input to data received during a mouse-tracking session by setting the mode to ``NSEventTrackingRunLoopMode``, or limit it to data received from a modal panel with ``NSModalPanelRunLoopMode``.
@property (copy) NSArray<NSRunLoopMode> *runLoopModes;
- /* Undo/Redo */
-
+/// Closes the top-level undo group if necessary and invokes ``undoNestedGroup``.
+///
+/// This method also invokes ``endUndoGrouping`` if the nesting level is 1. Raises an ``NSInternalInconsistencyException`` if more than one undo group is open (that is, if the last group isn’t at the top level).
+/// This method posts an ``NSUndoManagerCheckpointNotification``.
- (void)undo;
- // Undo until a matching begin. It terminates a top level undo if
- // necesary. Useful for undoing when groupByEvents is on (default is
- // on)
+
+/// Performs the operations in the last group on the redo stack, if there are any, recording them on the undo stack as a single group.
+///
+/// Raises an ``NSInternalInconsistencyException`` if the method is invoked during an undo operation.
+/// This method posts an ``NSUndoManagerCheckpointNotification`` and ``NSUndoManagerWillRedoChangeNotification`` before it performs the redo operation, and it posts the ``NSUndoManagerDidRedoChangeNotification`` after it performs the redo operation.
- (void)redo;
- // Will redo last top-level undo.
+/// Performs the undo operations in the last undo group (whether top-level or nested), recording the operations on the redo stack as a single group.
+///
+/// Raises an ``NSInternalInconsistencyException`` if any undo operations have been registered since the last ``enableUndoRegistration`` message.
+/// This method posts an ``NSUndoManagerCheckpointNotification`` and ``NSUndoManagerWillUndoChangeNotification`` before it performs the undo operation, and it posts an ``NSUndoManagerDidUndoChangeNotification`` after it performs the undo operation.
- (void)undoNestedGroup;
- // Undoes a nested grouping without first trying to close a top level
- // undo group.
+/// Whether the receiver has any actions to undo.
+///
+/// The return value does not mean you can safely invoke ``undo`` or ``undoNestedGroup`` — you may have to close open undo groups first.
@property (readonly) BOOL canUndo;
+
+/// Whether the receiver has any actions to redo.
+///
+/// Because any undo operation registered clears the redo stack, this method posts an NSUndoManagerCheckpointNotification to allow clients to apply their pending operations before testing the redo stack.
@property (readonly) BOOL canRedo;
- // returns whether or not the UndoManager has anything to undo or redo
+/// How many times `undo` can be invoked before there are no more actions left to
+/// be undone
+@property (readonly) NSUInteger undoCount API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4));
+/// How many times `redo` can be invoked before there are no more actions left to
+/// be redone
+@property (readonly) NSUInteger redoCount API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4));
+
+/// Whether the receiver is in the process of performing its ``undo`` or ``undoNestedGroup`` method.
@property (readonly, getter=isUndoing) BOOL undoing;
+
+/// Whether the receiver is in the process of performing its ``redo`` method.
@property (readonly, getter=isRedoing) BOOL redoing;
- // returns whether or not the undo manager is currently in the process
- // of invoking undo or redo operations.
- /* remove */
-
+/// Clears the undo and redo stacks and re-enables the receiver.
- (void)removeAllActions;
+/// Clears the undo and redo stacks of all operations involving the specified target as the recipient of the undo message.
+///
+/// Doesn't re-enable the receiver if it's disabled.
+///
+/// - Parameter target: The recepient of the undo mesages to be removed.
- (void)removeAllActionsWithTarget:(id)target;
- /* Object based Undo */
+/// Registers the selector of the specified target to implement a single undo operation that the target receives.
+///
+/// - Parameter target: The target of the undo operation. The undo manager maintains an unowned reference to `target` to prevent retain cycles.
+/// - Parameter selector: The selector for the undo operation.
+/// - Parameter object: The argument sent with the selector. The undo manager maintains a strong reference to `object`
+- (void)registerUndoWithTarget:(id)target selector:(SEL)selector object:(nullable id)object;
-- (void)registerUndoWithTarget:(id)target selector:(SEL)selector object:(nullable id)anObject;
-
- /* Invocation based undo */
-
+/// Prepares the undo manager for invocation-based undo with the given target as the subject of the next undo operation.
+///
+/// For example, when called as:
+///
+/// [[undoManager prepareWithInvocationTarget:target] setFont:oldFont color:oldColor]
+///
+/// When undo is called, the specified target will be called with
+///
+/// [target setFont:oldFont color:oldColor]
+///
+/// - Parameter target: The target of the undo operation. The undo manager maintains a weak reference to `target`.
+/// - Returns: A proxy object that forwards messages to the undo manager for recording as undo actions.
- (id)prepareWithInvocationTarget:(id)target;
- // called as:
- // [[undoManager prepareWithInvocationTarget:self] setFont:oldFont color:oldColor]
- // When undo is called, the specified target will be called with
- // [target setFont:oldFont color:oldColor]
-/*! @abstract records single undo operation for the specified target
- @param target non-nil target of the undo operation
- @param undoHandler non-nil block to be executed for the undo operation
- @discussion
- As with other undo operations, this does not strongly retain target. Care should be taken to avoid introducing retain cycles by other references captured by the block.
- */
+/// Records a single undo operation for a given target so that when an undo is performed, it executes the specified block.
+///
+/// As with other undo operations, this does not strongly retain target. Care should be taken to avoid introducing retain cycles by other references captured by the block.
+///
+/// - Parameter target: The target of the undo operation.
+/// - Parameter undoHandler: The block to be executed when an operation is undone. The block takes a single argument, the target of the undo operation.
- (void)registerUndoWithTarget:(id)target handler:(void (NS_SWIFT_SENDABLE ^)(id target))undoHandler API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) NS_REFINED_FOR_SWIFT;
+/// Sets whether the next undo or redo action is discardable.
+///
+/// Specifies that the latest undo action may be safely discarded when a document can not be saved for any reason.
+/// An example might be an undo action that changes the viewable area of a document.
+/// To find out if an undo group contains only discardable actions, look for the ``NSUndoManagerGroupIsDiscardableKey`` in the `userInfo` dictionary of the ``NSUndoManagerWillCloseUndoGroupNotification``.
+///
+/// - Parameter discardable: Specifies if the action is discardable. YES if the next undo or redo action can be discarded; NO otherwise.
- (void)setActionIsDiscardable:(BOOL)discardable API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
- // Set the latest undo action to discardable if it may be safely discarded when a document can not be saved for any reason. An example might be an undo action that changes the viewable area of a document. To find out if an undo group contains only discardable actions, look for the NSUndoManagerGroupIsDiscardableKey in the userInfo dictionary of the NSUndoManagerDidCloseUndoGroupNotification.
// This key is set on the user info dictionary of the NSUndoManagerDidCloseUndoGroupNotification, with a NSNumber boolean value of YES, if the undo group as a whole is discardable.
FOUNDATION_EXPORT NSString * const NSUndoManagerGroupIsDiscardableKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
+/// Whether the next undo action is discardable.
+///
+/// Specifies that the latest undo action may be safely discarded when a document can not be saved for any reason. These are typically actions that don’t affect persistent state.
+/// An example might be an undo action that changes the viewable area of a document.
@property (readonly) BOOL undoActionIsDiscardable API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
+
+/// Whether the next redo action is discardable.
+///
+/// Specifies that the latest redo action may be safely discarded when a document can not be saved for any reason. These are typically actions that don’t affect persistent state.
+/// An example might be an redo action that changes the viewable area of a document.
@property (readonly) BOOL redoActionIsDiscardable API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
- // Call to see if the next undo or redo action is discardable.
- /* Undo/Redo action name */
-
+/// The name identifying the undo action.
+///
+/// The undo action name. Returns an empty string if no action name has been assigned or if there is nothing to undo.
+/// For example, if the menu title is “Undo Delete,” the string returned is “Delete.”
@property (readonly, copy) NSString *undoActionName;
+
+/// The name identifying the redo action.
+///
+/// The redo action name. Returns an empty string if no action name has been assigned or if there is nothing to redo.
+/// For example, if the menu title is “Redo Delete,” the string returned is “Delete.”
@property (readonly, copy) NSString *redoActionName;
- // Call undoActionName or redoActionName to get the name of the next action to be undone or redone.
- // Returns @"" if there is nothing to undo/redo or no action names were registered.
+/// Sets the name of the action associated with the Undo or Redo command.
+///
+/// If actionName is an empty string, the action name currently associated with the menu command is removed. There is no effect if actionName is nil.
+///
+/// - Parameter actionName: The name of the action.
- (void)setActionName:(NSString *)actionName;
- // Call setActionName: to set the name of an action.
- // The actionName parameter can not be nil
- /* Undo/Redo menu item title */
+// Call undoMenuItemTitle or redoMenuItemTitle to get the string for the undo or redo menu item.
+// In English they will return "Undo <action name>"/"Redo <action name>" or "Undo"/"Redo" if there is
+// nothing to undo/redo or no action names were set.
+//
+/// The complete title of the Undo menu command, for example, “Undo Paste.”
+///
+/// Returns “Undo” if no action name has been assigned or nil if there is nothing to undo.
@property (readonly, copy) NSString *undoMenuItemTitle;
+
+/// The complete title of the Redo menu command, for example, “Redo Paste.”
+///
+/// Returns “Redo” if no action name has been assigned or nil if there is nothing to redo.
@property (readonly, copy) NSString *redoMenuItemTitle;
- // Call undoMenuItemTitle or redoMenuItemTitle to get the string for the undo or redo menu item.
- // In English they will return "Undo <action name>"/"Redo <action name>" or "Undo"/"Redo" if there is
- // nothing to undo/redo or no action names were set.
- /* localization hooks */
+// MARK: Localization hooks
+
+// The localization of the pattern is usually done by localizing the string patterns in
+// undo.strings. But undo/redoMenuTitleForUndoActionName can also be overridden if
+// localizing the pattern happens to not be sufficient.
+
+/// Returns the complete, localized title of the Undo menu command for the action identified by the given name.
+///
+/// Override this method if you want to customize the localization behaviour. This method is invoked by ``undoMenuItemTitle``.
+///
+/// - Parameter actionName: The name of the undo action.
+/// - Returns: The localized title of the undo menu item.
- (NSString *)undoMenuTitleForUndoActionName:(NSString *)actionName;
-- (NSString *)redoMenuTitleForUndoActionName:(NSString *)actionName;
- // The localization of the pattern is usually done by localizing the string patterns in
- // undo.strings. But undo/redoMenuTitleForUndoActionName can also be overridden if
- // localizing the pattern happens to not be sufficient.
+/// Returns the complete, localized title of the Redo menu command for the action identified by the given name.
+///
+/// Override this method if you want to customize the localization behaviour. This method is invoked by ``redoMenuItemTitle``.
+///
+/// - Parameter actionName: The name of the redo action.
+/// - Returns: The localized title of the redo menu item.
+- (NSString *)redoMenuTitleForUndoActionName:(NSString *)actionName;
@end
FOUNDATION_EXPORT NSNotificationName const NSUndoManagerCheckpointNotification API_AVAILABLE(macos(10.0), ios(3.0), watchos(2.0), tvos(9.0));
- README
- xcode13.0 Binding Status
- xcode13.1 Binding Status
- xcode13.2 Binding Status
- xcode13.3 Binding Status
- xcode13.4 Binding Status
- xcode14.0 Binding Status
- xcode14.1 Binding Status
- xcode14.2 Binding Status
- xcode14.3 Binding Status
- xcode15.0 Binding Status
- xcode15.1 Binding Status
- xcode15.3 Binding Status
- xcode15.4 Binding Status
- xcode16.0 Binding Status
- xcode16.1 Binding Status
- xcode16.2 Binding Status