chore(macos): vendor system-sdk dependency
This commit is contained in:
		
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -0,0 +1,186 @@
 | 
			
		||||
/*	Foundation.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include <CoreFoundation/CoreFoundation.h>
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSAutoreleasePool.h>
 | 
			
		||||
#import <Foundation/NSBundle.h>
 | 
			
		||||
#import <Foundation/NSByteOrder.h>
 | 
			
		||||
#import <Foundation/NSCalendar.h>
 | 
			
		||||
#import <Foundation/NSCharacterSet.h>
 | 
			
		||||
#import <Foundation/NSCoder.h>
 | 
			
		||||
#import <Foundation/NSData.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
#import <Foundation/NSDateInterval.h>
 | 
			
		||||
#import <Foundation/NSDateFormatter.h>
 | 
			
		||||
#import <Foundation/NSDateIntervalFormatter.h>
 | 
			
		||||
#import <Foundation/NSISO8601DateFormatter.h>
 | 
			
		||||
#import <Foundation/NSMassFormatter.h>
 | 
			
		||||
#import <Foundation/NSLengthFormatter.h>
 | 
			
		||||
#import <Foundation/NSEnergyFormatter.h>
 | 
			
		||||
#import <Foundation/NSMeasurement.h>
 | 
			
		||||
#import <Foundation/NSMeasurementFormatter.h>
 | 
			
		||||
#import <Foundation/NSPersonNameComponents.h>
 | 
			
		||||
#import <Foundation/NSPersonNameComponentsFormatter.h>
 | 
			
		||||
#import <Foundation/NSRelativeDateTimeFormatter.h>
 | 
			
		||||
#import <Foundation/NSListFormatter.h>
 | 
			
		||||
#import <Foundation/NSDecimal.h>
 | 
			
		||||
#import <Foundation/NSDecimalNumber.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSEnumerator.h>
 | 
			
		||||
#import <Foundation/NSError.h>
 | 
			
		||||
#import <Foundation/NSException.h>
 | 
			
		||||
#import <Foundation/NSFileHandle.h>
 | 
			
		||||
#import <Foundation/NSFileManager.h>
 | 
			
		||||
#import <Foundation/NSFormatter.h>
 | 
			
		||||
#import <Foundation/NSHashTable.h>
 | 
			
		||||
#import <Foundation/NSHTTPCookie.h>
 | 
			
		||||
#import <Foundation/NSHTTPCookieStorage.h>
 | 
			
		||||
#import <Foundation/NSIndexPath.h>
 | 
			
		||||
#import <Foundation/NSIndexSet.h>
 | 
			
		||||
#import <Foundation/NSInflectionRule.h>
 | 
			
		||||
#import <Foundation/NSInvocation.h>
 | 
			
		||||
#import <Foundation/NSJSONSerialization.h>
 | 
			
		||||
#import <Foundation/NSKeyValueCoding.h>
 | 
			
		||||
#import <Foundation/NSKeyValueObserving.h>
 | 
			
		||||
#import <Foundation/NSKeyedArchiver.h>
 | 
			
		||||
#import <Foundation/NSLocale.h>
 | 
			
		||||
#import <Foundation/NSLock.h>
 | 
			
		||||
#import <Foundation/NSMapTable.h>
 | 
			
		||||
#import <Foundation/NSMethodSignature.h>
 | 
			
		||||
#import <Foundation/NSMorphology.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
#import <Foundation/NSNotificationQueue.h>
 | 
			
		||||
#import <Foundation/NSNull.h>
 | 
			
		||||
#import <Foundation/NSNumberFormatter.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSOperation.h>
 | 
			
		||||
#import <Foundation/NSOrderedSet.h>
 | 
			
		||||
#import <Foundation/NSOrthography.h>
 | 
			
		||||
#import <Foundation/NSPathUtilities.h>
 | 
			
		||||
#import <Foundation/NSPointerArray.h>
 | 
			
		||||
#import <Foundation/NSPointerFunctions.h>
 | 
			
		||||
#import <Foundation/NSPort.h>
 | 
			
		||||
#import <Foundation/NSProcessInfo.h>
 | 
			
		||||
#import <Foundation/NSPropertyList.h>
 | 
			
		||||
#import <Foundation/NSProxy.h>
 | 
			
		||||
#import <Foundation/NSRange.h>
 | 
			
		||||
#import <Foundation/NSRegularExpression.h>
 | 
			
		||||
#import <Foundation/NSRunLoop.h>
 | 
			
		||||
#import <Foundation/NSScanner.h>
 | 
			
		||||
#import <Foundation/NSSet.h>
 | 
			
		||||
#import <Foundation/NSSortDescriptor.h>
 | 
			
		||||
#import <Foundation/NSStream.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <Foundation/NSTextCheckingResult.h>
 | 
			
		||||
#import <Foundation/NSThread.h>
 | 
			
		||||
#import <Foundation/NSTimeZone.h>
 | 
			
		||||
#import <Foundation/NSTimer.h>
 | 
			
		||||
#import <Foundation/NSUnit.h>
 | 
			
		||||
#import <Foundation/NSURL.h>
 | 
			
		||||
#import <Foundation/NSURLAuthenticationChallenge.h>
 | 
			
		||||
#import <Foundation/NSURLCache.h>
 | 
			
		||||
#import <Foundation/NSURLConnection.h>
 | 
			
		||||
#import <Foundation/NSURLCredential.h>
 | 
			
		||||
#import <Foundation/NSURLCredentialStorage.h>
 | 
			
		||||
#import <Foundation/NSURLError.h>
 | 
			
		||||
#import <Foundation/NSURLProtectionSpace.h>
 | 
			
		||||
#import <Foundation/NSURLProtocol.h>
 | 
			
		||||
#import <Foundation/NSURLRequest.h>
 | 
			
		||||
#import <Foundation/NSURLResponse.h>
 | 
			
		||||
#import <Foundation/NSUserDefaults.h>
 | 
			
		||||
#import <Foundation/NSValue.h>
 | 
			
		||||
#import <Foundation/NSValueTransformer.h>
 | 
			
		||||
#import <Foundation/NSXMLParser.h>
 | 
			
		||||
#import <Foundation/NSXPCConnection.h>
 | 
			
		||||
#import <Foundation/NSZone.h>
 | 
			
		||||
 | 
			
		||||
#import <Foundation/FoundationErrors.h>
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX || TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSAttributedString.h>
 | 
			
		||||
#import <Foundation/NSByteCountFormatter.h>
 | 
			
		||||
#import <Foundation/NSCache.h>
 | 
			
		||||
#import <Foundation/NSComparisonPredicate.h>
 | 
			
		||||
#import <Foundation/NSCompoundPredicate.h>
 | 
			
		||||
#import <Foundation/NSDateComponentsFormatter.h>
 | 
			
		||||
#import <Foundation/NSExpression.h>
 | 
			
		||||
#import <Foundation/NSExtensionContext.h>
 | 
			
		||||
#import <Foundation/NSExtensionItem.h>
 | 
			
		||||
#import <Foundation/NSExtensionRequestHandling.h>
 | 
			
		||||
#import <Foundation/NSFileCoordinator.h>
 | 
			
		||||
#import <Foundation/NSFilePresenter.h>
 | 
			
		||||
#import <Foundation/NSFileVersion.h>
 | 
			
		||||
#import <Foundation/NSFileWrapper.h>
 | 
			
		||||
#import <Foundation/NSItemProvider.h>
 | 
			
		||||
#import <Foundation/NSLinguisticTagger.h>
 | 
			
		||||
#import <Foundation/NSMetadata.h>
 | 
			
		||||
#import <Foundation/NSMetadataAttributes.h>
 | 
			
		||||
#import <Foundation/NSNetServices.h>
 | 
			
		||||
#import <Foundation/NSPredicate.h>
 | 
			
		||||
#import <Foundation/NSProgress.h>
 | 
			
		||||
#import <Foundation/NSUbiquitousKeyValueStore.h>
 | 
			
		||||
#import <Foundation/NSUndoManager.h>
 | 
			
		||||
#import <Foundation/NSURLSession.h>
 | 
			
		||||
#import <Foundation/NSUserActivity.h>
 | 
			
		||||
#import <Foundation/NSUUID.h>
 | 
			
		||||
 | 
			
		||||
#endif /* TARGET_OS_OSX || TARGET_OS_IPHONE */
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX || TARGET_OS_MACCATALYST
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSAffineTransform.h>
 | 
			
		||||
#import <Foundation/NSAppleScript.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArchiver.h>
 | 
			
		||||
#import <Foundation/NSBackgroundActivityScheduler.h>
 | 
			
		||||
#import <Foundation/NSCalendarDate.h>
 | 
			
		||||
#import <Foundation/NSConnection.h>
 | 
			
		||||
#import <Foundation/NSDistantObject.h>
 | 
			
		||||
#import <Foundation/NSDistributedNotificationCenter.h>
 | 
			
		||||
#import <Foundation/NSPortCoder.h>
 | 
			
		||||
#import <Foundation/NSPortMessage.h>
 | 
			
		||||
#import <Foundation/NSPortNameServer.h>
 | 
			
		||||
#import <Foundation/NSProtocolChecker.h>
 | 
			
		||||
#import <Foundation/NSTask.h>
 | 
			
		||||
#import <Foundation/NSXMLDTD.h>
 | 
			
		||||
#import <Foundation/NSXMLDTDNode.h>
 | 
			
		||||
#import <Foundation/NSXMLDocument.h>
 | 
			
		||||
#import <Foundation/NSXMLElement.h>
 | 
			
		||||
#import <Foundation/NSXMLNode.h>
 | 
			
		||||
#import <Foundation/NSXMLNodeOptions.h>
 | 
			
		||||
#import <Foundation/NSURLDownload.h>
 | 
			
		||||
#import <Foundation/NSURLHandle.h>
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSAppleEventDescriptor.h>
 | 
			
		||||
#import <Foundation/NSAppleEventManager.h>
 | 
			
		||||
#import <Foundation/NSClassDescription.h>
 | 
			
		||||
#import <Foundation/NSDistributedLock.h>
 | 
			
		||||
#import <Foundation/NSGarbageCollector.h>
 | 
			
		||||
#import <Foundation/NSHFSFileTypes.h>
 | 
			
		||||
#import <Foundation/NSHost.h>
 | 
			
		||||
#import <Foundation/NSObjectScripting.h>
 | 
			
		||||
#import <Foundation/NSScriptClassDescription.h>
 | 
			
		||||
#import <Foundation/NSScriptCoercionHandler.h>
 | 
			
		||||
#import <Foundation/NSScriptCommand.h>
 | 
			
		||||
#import <Foundation/NSScriptCommandDescription.h>
 | 
			
		||||
#import <Foundation/NSScriptExecutionContext.h>
 | 
			
		||||
#import <Foundation/NSScriptKeyValueCoding.h>
 | 
			
		||||
#import <Foundation/NSScriptObjectSpecifiers.h>
 | 
			
		||||
#import <Foundation/NSScriptStandardSuiteCommands.h>
 | 
			
		||||
#import <Foundation/NSScriptSuiteRegistry.h>
 | 
			
		||||
#import <Foundation/NSScriptWhoseTests.h>
 | 
			
		||||
#import <Foundation/NSSpellServer.h>
 | 
			
		||||
#import <Foundation/NSUserNotification.h>
 | 
			
		||||
#import <Foundation/NSUserScriptTask.h>
 | 
			
		||||
 | 
			
		||||
#endif /* TARGET_OS_OSX || TARGET_OS_MACCATALYST */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/FoundationLegacySwiftCompatibility.h>
 | 
			
		||||
@@ -0,0 +1,123 @@
 | 
			
		||||
/*	FoundationErrors.h
 | 
			
		||||
	Copyright (c) 2004-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSError.h>
 | 
			
		||||
 | 
			
		||||
/* NSError codes in NSCocoaErrorDomain. Note that other frameworks (such as AppKit and CoreData) also provide additional NSCocoaErrorDomain error codes.
 | 
			
		||||
*/
 | 
			
		||||
NS_ERROR_ENUM(NSCocoaErrorDomain) {
 | 
			
		||||
    // File system and file I/O related errors, with NSFilePathErrorKey or NSURLErrorKey containing path or URL
 | 
			
		||||
    NSFileNoSuchFileError = 4,                                              // Attempt to do a file system operation on a non-existent file
 | 
			
		||||
    NSFileLockingError = 255,                                               // Couldn't get a lock on file
 | 
			
		||||
    NSFileReadUnknownError = 256,                                           // Read error (reason unknown)
 | 
			
		||||
    NSFileReadNoPermissionError = 257,                                      // Read error (permission problem)
 | 
			
		||||
    NSFileReadInvalidFileNameError = 258,                                   // Read error (invalid file name)
 | 
			
		||||
    NSFileReadCorruptFileError = 259,                                       // Read error (file corrupt, bad format, etc)
 | 
			
		||||
    NSFileReadNoSuchFileError = 260,                                        // Read error (no such file)
 | 
			
		||||
    NSFileReadInapplicableStringEncodingError = 261,                        // Read error (string encoding not applicable) also NSStringEncodingErrorKey
 | 
			
		||||
    NSFileReadUnsupportedSchemeError = 262,                                 // Read error (unsupported URL scheme)
 | 
			
		||||
    NSFileReadTooLargeError API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 263,             // Read error (file too large)
 | 
			
		||||
    NSFileReadUnknownStringEncodingError API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 264, // Read error (string encoding of file contents could not be determined)
 | 
			
		||||
    NSFileWriteUnknownError = 512,                                          // Write error (reason unknown)
 | 
			
		||||
    NSFileWriteNoPermissionError = 513,                                     // Write error (permission problem)
 | 
			
		||||
    NSFileWriteInvalidFileNameError = 514,                                  // Write error (invalid file name)
 | 
			
		||||
    NSFileWriteFileExistsError API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)) = 516,          // Write error (file exists)
 | 
			
		||||
    NSFileWriteInapplicableStringEncodingError = 517,                       // Write error (string encoding not applicable) also NSStringEncodingErrorKey
 | 
			
		||||
    NSFileWriteUnsupportedSchemeError = 518,                                // Write error (unsupported URL scheme)
 | 
			
		||||
    NSFileWriteOutOfSpaceError = 640,                                       // Write error (out of disk space)
 | 
			
		||||
    NSFileWriteVolumeReadOnlyError API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 642,      // Write error (readonly volume)
 | 
			
		||||
 | 
			
		||||
    // NSFileManager unmount errors
 | 
			
		||||
    NSFileManagerUnmountUnknownError API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos) = 768,    // The volume could not be unmounted (reason unknown)
 | 
			
		||||
    NSFileManagerUnmountBusyError API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos) = 769,       // The volume could not be unmounted because it is in use
 | 
			
		||||
 | 
			
		||||
    // Other errors
 | 
			
		||||
    NSKeyValueValidationError = 1024,                                       // KVC validation error
 | 
			
		||||
    NSFormattingError = 2048,                                               // Formatting error
 | 
			
		||||
    NSUserCancelledError = 3072,                                            // User cancelled operation (this one often doesn't deserve a panel and might be a good one to special case)
 | 
			
		||||
    NSFeatureUnsupportedError API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)) = 3328,          // Feature unsupported error
 | 
			
		||||
    
 | 
			
		||||
    // Executable loading errors
 | 
			
		||||
    NSExecutableNotLoadableError API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 3584,           // Executable is of a type that is not loadable in the current process
 | 
			
		||||
    NSExecutableArchitectureMismatchError API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 3585,  // Executable does not provide an architecture compatible with the current process
 | 
			
		||||
    NSExecutableRuntimeMismatchError API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 3586,       // Executable has Objective C runtime information incompatible with the current process
 | 
			
		||||
    NSExecutableLoadError API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 3587,                  // Executable cannot be loaded for some other reason, such as a problem with a library it depends on
 | 
			
		||||
    NSExecutableLinkError API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 3588,                  // Executable fails due to linking issues
 | 
			
		||||
    
 | 
			
		||||
    // Inclusive error range definitions, for checking future error codes
 | 
			
		||||
    NSFileErrorMinimum = 0,
 | 
			
		||||
    NSFileErrorMaximum = 1023,
 | 
			
		||||
    
 | 
			
		||||
    NSValidationErrorMinimum = 1024,
 | 
			
		||||
    NSValidationErrorMaximum = 2047,
 | 
			
		||||
 | 
			
		||||
    NSExecutableErrorMinimum API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 3584,
 | 
			
		||||
    NSExecutableErrorMaximum API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 3839,
 | 
			
		||||
 | 
			
		||||
    NSFormattingErrorMinimum = 2048,
 | 
			
		||||
    NSFormattingErrorMaximum = 2559,
 | 
			
		||||
    
 | 
			
		||||
    NSPropertyListReadCorruptError API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 3840,         // Error parsing a property list
 | 
			
		||||
    NSPropertyListReadUnknownVersionError API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 3841,  // The version number in the property list is unknown
 | 
			
		||||
    NSPropertyListReadStreamError API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 3842,          // Stream error reading a property list
 | 
			
		||||
    NSPropertyListWriteStreamError API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 3851,         // Stream error writing a property list
 | 
			
		||||
    NSPropertyListWriteInvalidError API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) = 3852,       // Invalid property list object or invalid property list type specified when writing
 | 
			
		||||
 | 
			
		||||
    NSPropertyListErrorMinimum API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 3840,
 | 
			
		||||
    NSPropertyListErrorMaximum API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 4095,
 | 
			
		||||
 | 
			
		||||
    NSXPCConnectionInterrupted API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)) = 4097,
 | 
			
		||||
    NSXPCConnectionInvalid API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)) = 4099,
 | 
			
		||||
    NSXPCConnectionReplyInvalid API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)) = 4101,
 | 
			
		||||
    
 | 
			
		||||
    NSXPCConnectionErrorMinimum API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)) = 4096,
 | 
			
		||||
    NSXPCConnectionErrorMaximum API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)) = 4224,
 | 
			
		||||
 | 
			
		||||
    NSUbiquitousFileUnavailableError API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = 4353, // NSURLUbiquitousItemDownloadingErrorKey contains an error with this code when the item has not been uploaded to iCloud by the other devices yet
 | 
			
		||||
    NSUbiquitousFileNotUploadedDueToQuotaError API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = 4354, // NSURLUbiquitousItemUploadingErrorKey contains an error with this code when the item has not been uploaded to iCloud because it would make the account go over-quota
 | 
			
		||||
    NSUbiquitousFileUbiquityServerNotAvailable API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = 4355, // NSURLUbiquitousItemDownloadingErrorKey and NSURLUbiquitousItemUploadingErrorKey contain an error with this code when connecting to the iCloud servers failed
 | 
			
		||||
 | 
			
		||||
    NSUbiquitousFileErrorMinimum API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = 4352,
 | 
			
		||||
    NSUbiquitousFileErrorMaximum API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = 4607,
 | 
			
		||||
 | 
			
		||||
    NSUserActivityHandoffFailedError API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) = 4608,	// The data for the user activity was not available (e.g. if the remote device became unavailable.)
 | 
			
		||||
    NSUserActivityConnectionUnavailableError API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) = 4609,  // The user activity could not be continued because a required connection was not available
 | 
			
		||||
    NSUserActivityRemoteApplicationTimedOutError API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) = 4610, // The remote application failed to send data in time
 | 
			
		||||
    NSUserActivityHandoffUserInfoTooLargeError API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) = 4611, // The NSUserActivity userInfo dictionary was too large to receive
 | 
			
		||||
 | 
			
		||||
    NSUserActivityErrorMinimum API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) = 4608,
 | 
			
		||||
    NSUserActivityErrorMaximum API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) = 4863,
 | 
			
		||||
    
 | 
			
		||||
    NSCoderReadCorruptError API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = 4864, // Error parsing data during decode
 | 
			
		||||
    NSCoderValueNotFoundError API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = 4865, // Data requested was not found
 | 
			
		||||
    NSCoderInvalidValueError API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0)) = 4866, // Data was not valid to encode
 | 
			
		||||
    NSCoderErrorMinimum API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = 4864,
 | 
			
		||||
    NSCoderErrorMaximum API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = 4991,
 | 
			
		||||
    
 | 
			
		||||
    NSBundleErrorMinimum API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = 4992,
 | 
			
		||||
    NSBundleErrorMaximum API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = 5119,
 | 
			
		||||
    
 | 
			
		||||
    NSBundleOnDemandResourceOutOfSpaceError API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = 4992, // There was not enough space available to download the requested On Demand Resources.
 | 
			
		||||
    NSBundleOnDemandResourceExceededMaximumSizeError API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = 4993, // The application exceeded the amount of On Demand Resources content in use at one time
 | 
			
		||||
    NSBundleOnDemandResourceInvalidTagError API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = 4994, // The application specified a tag which the system could not find in the application tag manifest
 | 
			
		||||
    
 | 
			
		||||
    NSCloudSharingNetworkFailureError API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos) = 5120,        // Sharing failed due to a network failure.
 | 
			
		||||
    NSCloudSharingQuotaExceededError API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos) = 5121,         // The user doesn't have enough storage space available to share the requested items.
 | 
			
		||||
    NSCloudSharingTooManyParticipantsError API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos) = 5122,   // Additional participants could not be added to the share, because the limit was reached.
 | 
			
		||||
    NSCloudSharingConflictError API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos) = 5123,              // A conflict occurred while trying to save changes to the CKShare and/or root CKRecord. Respond to this error by first fetching the server's changes to the records, then either handle the conflict manually or present it, which will instruct the user to try the operation again.
 | 
			
		||||
    NSCloudSharingNoPermissionError API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos) = 5124,         // The current user doesn't have permission to perform the requested actions.
 | 
			
		||||
    NSCloudSharingOtherError API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos) = 5375,                 // These errors may require application-specific responses. For CloudKit sharing, use the NSUnderlyingErrorKey, which is a CKErrorDomain error, to discover the specific error and refer to the CloudKit documentation for the proper response to these errors.
 | 
			
		||||
    
 | 
			
		||||
    NSCloudSharingErrorMinimum API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos) = 5120,
 | 
			
		||||
    NSCloudSharingErrorMaximum API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos) = 5375,
 | 
			
		||||
    
 | 
			
		||||
    NSCompressionFailedError API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) = 5376,
 | 
			
		||||
    NSDecompressionFailedError API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) = 5377,
 | 
			
		||||
    
 | 
			
		||||
    NSCompressionErrorMinimum API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) = 5376,
 | 
			
		||||
    NSCompressionErrorMaximum API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) = 5503,
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
@@ -0,0 +1,52 @@
 | 
			
		||||
/*	NSAffineTransform.h
 | 
			
		||||
        Copyright (c) 1997-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <CoreGraphics/CGAffineTransform.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    CGFloat m11, m12, m21, m22;
 | 
			
		||||
    CGFloat tX, tY;
 | 
			
		||||
} NSAffineTransformStruct;
 | 
			
		||||
 | 
			
		||||
@interface NSAffineTransform : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
// Creation
 | 
			
		||||
+ (NSAffineTransform *)transform;
 | 
			
		||||
 | 
			
		||||
// Initialization
 | 
			
		||||
- (instancetype)initWithTransform:(NSAffineTransform *)transform;
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
// Translating
 | 
			
		||||
- (void)translateXBy:(CGFloat)deltaX yBy:(CGFloat)deltaY;
 | 
			
		||||
 | 
			
		||||
// Rotating
 | 
			
		||||
- (void)rotateByDegrees:(CGFloat)angle;
 | 
			
		||||
- (void)rotateByRadians:(CGFloat)angle;
 | 
			
		||||
 | 
			
		||||
// Scaling
 | 
			
		||||
- (void)scaleBy:(CGFloat)scale;
 | 
			
		||||
- (void)scaleXBy:(CGFloat)scaleX yBy:(CGFloat)scaleY;
 | 
			
		||||
 | 
			
		||||
// Inverting
 | 
			
		||||
- (void)invert;
 | 
			
		||||
 | 
			
		||||
// Transforming with transform
 | 
			
		||||
- (void)appendTransform:(NSAffineTransform *)transform;
 | 
			
		||||
- (void)prependTransform:(NSAffineTransform *)transform;
 | 
			
		||||
 | 
			
		||||
// Transforming points and sizes
 | 
			
		||||
- (NSPoint)transformPoint:(NSPoint)aPoint;
 | 
			
		||||
- (NSSize)transformSize:(NSSize)aSize;
 | 
			
		||||
 | 
			
		||||
// Transform Struct
 | 
			
		||||
@property NSAffineTransformStruct transformStruct;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,137 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSAppleEventDescriptor.h
 | 
			
		||||
	Copyright (c) 1997-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
#import <CoreServices/CoreServices.h>
 | 
			
		||||
 | 
			
		||||
@class NSData;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSAppleEventSendOptions) {
 | 
			
		||||
    NSAppleEventSendNoReply        = kAENoReply, /* sender doesn't want a reply to event */
 | 
			
		||||
    NSAppleEventSendQueueReply     = kAEQueueReply, /* sender wants a reply but won't wait */
 | 
			
		||||
    NSAppleEventSendWaitForReply   = kAEWaitReply, /* sender wants a reply and will wait */
 | 
			
		||||
    NSAppleEventSendNeverInteract  = kAENeverInteract, /* server should not interact with user */
 | 
			
		||||
    NSAppleEventSendCanInteract    = kAECanInteract, /* server may try to interact with user */
 | 
			
		||||
    NSAppleEventSendAlwaysInteract = kAEAlwaysInteract, /* server should always interact with user where appropriate */
 | 
			
		||||
    NSAppleEventSendCanSwitchLayer = kAECanSwitchLayer, /* interaction may switch layer */
 | 
			
		||||
    NSAppleEventSendDontRecord     = kAEDontRecord, /* don't record this event */
 | 
			
		||||
    NSAppleEventSendDontExecute    = kAEDontExecute, /* don't execute this event; used for recording */
 | 
			
		||||
    NSAppleEventSendDontAnnotate   = kAEDoNotAutomaticallyAddAnnotationsToEvent, /* don't automatically add any sandbox or other annotations to the event */
 | 
			
		||||
 | 
			
		||||
    NSAppleEventSendDefaultOptions = NSAppleEventSendWaitForReply | NSAppleEventSendCanInteract
 | 
			
		||||
} API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
@interface NSAppleEventDescriptor : NSObject<NSCopying, NSSecureCoding> {
 | 
			
		||||
    @private
 | 
			
		||||
    AEDesc _desc;
 | 
			
		||||
    BOOL _hasValidDesc;
 | 
			
		||||
    char _padding[3];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Create an autoreleased NSAppleEventDescriptor whose AEDesc type is typeNull.
 | 
			
		||||
+ (NSAppleEventDescriptor *)nullDescriptor;
 | 
			
		||||
 | 
			
		||||
// Given some data, and a four-character type code, create and return an autoreleased NSAppleEventDescriptor that contains that data, with that type.
 | 
			
		||||
+ (nullable NSAppleEventDescriptor *)descriptorWithDescriptorType:(DescType)descriptorType bytes:(nullable const void *)bytes length:(NSUInteger)byteCount;
 | 
			
		||||
+ (nullable NSAppleEventDescriptor *)descriptorWithDescriptorType:(DescType)descriptorType data:(nullable NSData *)data;
 | 
			
		||||
 | 
			
		||||
// Given a value, create and return an autoreleased NSAppleEventDescriptor that contains that value, with an appropriate type (typeBoolean, typeEnumerated, typeSInt32, typeIEEE64BitFloatingPoint, or typeType, respectively).
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithBoolean:(Boolean)boolean;
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithEnumCode:(OSType)enumerator;
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithInt32:(SInt32)signedInt;
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithDouble:(double)doubleValue API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithTypeCode:(OSType)typeCode;
 | 
			
		||||
 | 
			
		||||
// Given a string, date, or file URL object, respectively, create and return an autoreleased NSAppleEventDescriptor that contains that value.
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithString:(NSString *)string;
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithDate:(NSDate *)date API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithFileURL:(NSURL *)fileURL API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
// Create and return an autoreleased event, list, or record NSAppleEventDescriptor, respectively.
 | 
			
		||||
+ (NSAppleEventDescriptor *)appleEventWithEventClass:(AEEventClass)eventClass eventID:(AEEventID)eventID targetDescriptor:(nullable NSAppleEventDescriptor *)targetDescriptor returnID:(AEReturnID)returnID transactionID:(AETransactionID)transactionID;
 | 
			
		||||
+ (NSAppleEventDescriptor *)listDescriptor;
 | 
			
		||||
+ (NSAppleEventDescriptor *)recordDescriptor;
 | 
			
		||||
 | 
			
		||||
// Create and return an autoreleased application address descriptor using the current process, a pid, a url referring to an application, or an application bundle identifier, respectively.  The result is suitable for use as the "targetDescriptor" parameter of +appleEventWithEventClass:/initWithEventClass:.
 | 
			
		||||
+ (NSAppleEventDescriptor *)currentProcessDescriptor API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithProcessIdentifier:(pid_t)processIdentifier API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithBundleIdentifier:(NSString *)bundleIdentifier API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
+ (NSAppleEventDescriptor *)descriptorWithApplicationURL:(NSURL *)applicationURL API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
// The designated initializer.  The initialized object takes ownership of the passed-in AEDesc, and will call AEDisposeDesc() on it at deallocation time.
 | 
			
		||||
- (instancetype)initWithAEDescNoCopy:(const AEDesc *)aeDesc NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
// Other initializers.
 | 
			
		||||
- (nullable instancetype)initWithDescriptorType:(DescType)descriptorType bytes:(nullable const void *)bytes length:(NSUInteger)byteCount;
 | 
			
		||||
- (nullable instancetype)initWithDescriptorType:(DescType)descriptorType data:(nullable NSData *)data;
 | 
			
		||||
- (instancetype)initWithEventClass:(AEEventClass)eventClass eventID:(AEEventID)eventID targetDescriptor:(nullable NSAppleEventDescriptor *)targetDescriptor returnID:(AEReturnID)returnID transactionID:(AETransactionID)transactionID;
 | 
			
		||||
- (instancetype)initListDescriptor;
 | 
			
		||||
- (instancetype)initRecordDescriptor;
 | 
			
		||||
 | 
			
		||||
// Return a pointer to the AEDesc that is encapsulated by the object.
 | 
			
		||||
@property (nullable, readonly) const AEDesc *aeDesc NS_RETURNS_INNER_POINTER;
 | 
			
		||||
 | 
			
		||||
// Get the four-character type code or the data from a fully-initialized descriptor.
 | 
			
		||||
@property (readonly) DescType descriptorType;
 | 
			
		||||
@property (readonly, copy) NSData *data;
 | 
			
		||||
 | 
			
		||||
// Return the contents of a descriptor, after coercing the descriptor's contents to typeBoolean, typeEnumerated, typeSInt32, typeIEEE64BitFloatingPoint, or typeType, respectively.
 | 
			
		||||
@property (readonly) Boolean booleanValue;
 | 
			
		||||
@property (readonly) OSType enumCodeValue;
 | 
			
		||||
@property (readonly) SInt32 int32Value;
 | 
			
		||||
@property (readonly) double doubleValue API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
@property (readonly) OSType typeCodeValue;
 | 
			
		||||
 | 
			
		||||
// Return the contents of a descriptor, after coercing the descriptor's contents to a string, date, or file URL, respectively.
 | 
			
		||||
@property (nullable, readonly, copy) NSString *stringValue;
 | 
			
		||||
@property (nullable, readonly, copy) NSDate *dateValue API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *fileURLValue API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
// Accessors for an event descriptor.
 | 
			
		||||
@property (readonly) AEEventClass eventClass;
 | 
			
		||||
@property (readonly) AEEventID eventID;
 | 
			
		||||
@property (readonly) AEReturnID returnID;
 | 
			
		||||
@property (readonly) AETransactionID transactionID;
 | 
			
		||||
 | 
			
		||||
// Set, retrieve, or remove parameter descriptors inside an event descriptor.
 | 
			
		||||
- (void)setParamDescriptor:(NSAppleEventDescriptor *)descriptor forKeyword:(AEKeyword)keyword;
 | 
			
		||||
- (nullable NSAppleEventDescriptor *)paramDescriptorForKeyword:(AEKeyword)keyword;
 | 
			
		||||
- (void)removeParamDescriptorWithKeyword:(AEKeyword)keyword;
 | 
			
		||||
 | 
			
		||||
// Set or retrieve attribute descriptors inside an event descriptor.
 | 
			
		||||
- (void)setAttributeDescriptor:(NSAppleEventDescriptor *)descriptor forKeyword:(AEKeyword)keyword;
 | 
			
		||||
- (nullable NSAppleEventDescriptor *)attributeDescriptorForKeyword:(AEKeyword)keyword;
 | 
			
		||||
 | 
			
		||||
// Send an Apple event.
 | 
			
		||||
- (nullable NSAppleEventDescriptor *)sendEventWithOptions:(NSAppleEventSendOptions)sendOptions timeout:(NSTimeInterval)timeoutInSeconds error:(NSError **)error API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
// Return whether or not a descriptor is a record-like descriptor.  Record-like descriptors function as records, but may have a descriptorType other than typeAERecord, such as typeObjectSpecifier.
 | 
			
		||||
@property (readonly) BOOL isRecordDescriptor API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
// Return the number of items inside a list or record descriptor.
 | 
			
		||||
@property (readonly) NSInteger numberOfItems;
 | 
			
		||||
 | 
			
		||||
// Set, retrieve, or remove indexed descriptors inside a list or record descriptor.
 | 
			
		||||
- (void)insertDescriptor:(NSAppleEventDescriptor *)descriptor atIndex:(NSInteger)index;
 | 
			
		||||
- (nullable NSAppleEventDescriptor *)descriptorAtIndex:(NSInteger)index;
 | 
			
		||||
- (void)removeDescriptorAtIndex:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
// Set, retrieve, or remove keyed descriptors inside a record descriptor.
 | 
			
		||||
- (void)setDescriptor:(NSAppleEventDescriptor *)descriptor forKeyword:(AEKeyword)keyword;
 | 
			
		||||
- (nullable NSAppleEventDescriptor *)descriptorForKeyword:(AEKeyword)keyword;
 | 
			
		||||
- (void)removeDescriptorWithKeyword:(AEKeyword)keyword;
 | 
			
		||||
 | 
			
		||||
// Return the keyword associated with an indexed descriptor inside a record descriptor.
 | 
			
		||||
- (AEKeyword)keywordForDescriptorAtIndex:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
// Create and return a descriptor of the requested type, doing a coercion if that's appropriate and possible.
 | 
			
		||||
- (nullable NSAppleEventDescriptor *)coerceToDescriptorType:(DescType)descriptorType;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,63 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSAppleEventManager.h
 | 
			
		||||
	Copyright (c) 1997-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <CoreServices/CoreServices.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
 | 
			
		||||
@class NSAppleEventDescriptor;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef const struct __NSAppleEventManagerSuspension* NSAppleEventManagerSuspensionID;
 | 
			
		||||
 | 
			
		||||
extern const double NSAppleEventTimeOutDefault;
 | 
			
		||||
extern const double NSAppleEventTimeOutNone;
 | 
			
		||||
 | 
			
		||||
extern NSNotificationName NSAppleEventManagerWillProcessFirstEventNotification;
 | 
			
		||||
 | 
			
		||||
@interface NSAppleEventManager : NSObject {
 | 
			
		||||
    @private
 | 
			
		||||
    BOOL _isPreparedForDispatch;
 | 
			
		||||
    char _padding[3];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Get the pointer to the program's single NSAppleEventManager.
 | 
			
		||||
+ (NSAppleEventManager *)sharedAppleEventManager;
 | 
			
		||||
 | 
			
		||||
// Set or remove a handler for a specific kind of Apple Event.  The handler method should have the same signature as:
 | 
			
		||||
// - (void)handleAppleEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent;
 | 
			
		||||
// When it is invoked, the value of the first parameter will be the event to be handled.  The value of the second parameter will be the reply event to fill in.  A reply event object will always be passed in (replyEvent will never be nil), but it should not be touched if the event sender has not requested a reply, which is indicated by [replyEvent descriptorType]==typeNull.
 | 
			
		||||
- (void)setEventHandler:(id)handler andSelector:(SEL)handleEventSelector forEventClass:(AEEventClass)eventClass andEventID:(AEEventID)eventID;
 | 
			
		||||
- (void)removeEventHandlerForEventClass:(AEEventClass)eventClass andEventID:(AEEventID)eventID;
 | 
			
		||||
 | 
			
		||||
// Given an event, reply event, and refCon of the sort passed into Apple event handler functions that can be registered with AEInstallEventHandler(), dispatch the event to a handler that has been registered with -setEventHandler:andSelector:forEventClass:andEventID:.
 | 
			
		||||
// This method is primarily meant for Cocoa's internal use.  It does not send events to other applications!
 | 
			
		||||
- (OSErr)dispatchRawAppleEvent:(const AppleEvent *)theAppleEvent withRawReply:(AppleEvent *)theReply handlerRefCon:(SRefCon)handlerRefCon;
 | 
			
		||||
 | 
			
		||||
// If an Apple event is being handled on the current thread (i.e., a handler that was registered with -setEventHandler:andSelector:forEventClass:andEventID: is being messaged at this instant or -setCurrentAppleEventAndReplyEventWithSuspensionID: has just been invoked), return the descriptor for the event.  Return nil otherwise.  The effects of mutating or retaining the returned descriptor are undefined, though it may be copied.
 | 
			
		||||
@property (nullable, readonly, retain) NSAppleEventDescriptor *currentAppleEvent;
 | 
			
		||||
 | 
			
		||||
// If an Apple event is being handled on the current thread (i.e., -currentAppleEvent would not return nil), return the corresponding reply event descriptor.  Return nil otherwise.  This descriptor, including any mutatations, will be returned to the sender of the current event when all handling of the event has been completed, if the sender has requested a reply.  The effects of retaining the descriptor are undefined; it may be copied, but mutations of the copy will not be returned to the sender of the current event.
 | 
			
		||||
@property (nullable, readonly, retain) NSAppleEventDescriptor *currentReplyAppleEvent;
 | 
			
		||||
 | 
			
		||||
// If an Apple event is being handled on the current thread (i.e., -currentAppleEvent would not return nil), suspend the handling of the event, returning an ID that must be used to resume the handling of the event.  Return zero otherwise.  The suspended event will no longer be the current event after this method has returned.
 | 
			
		||||
- (nullable NSAppleEventManagerSuspensionID)suspendCurrentAppleEvent NS_RETURNS_INNER_POINTER;
 | 
			
		||||
 | 
			
		||||
// Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, return the descriptor for the event whose handling was suspended.  The effects of mutating or retaining the returned descriptor are undefined, though it may be copied.  This method may be invoked in any thread, not just the one in which the corresponding invocation of -suspendCurrentAppleEvent occurred.
 | 
			
		||||
- (NSAppleEventDescriptor *)appleEventForSuspensionID:(NSAppleEventManagerSuspensionID)suspensionID;
 | 
			
		||||
 | 
			
		||||
// Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, return the corresponding reply event descriptor.  This descriptor, including any mutatations, will be returned to the sender of the suspended event when handling of the event is resumed, if the sender has requested a reply.  The effects of retaining the descriptor are undefined; it may be copied, but mutations of the copy will not be returned to the sender of the suspended event.  This method may be invoked in any thread, not just the one in which the corresponding invocation of -suspendCurrentAppleEvent occurred.
 | 
			
		||||
- (NSAppleEventDescriptor *)replyAppleEventForSuspensionID:(NSAppleEventManagerSuspensionID)suspensionID;
 | 
			
		||||
 | 
			
		||||
// Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, set the values that will be returned by subsequent invocations of -currentAppleEvent and -currentReplyAppleEvent to be the event whose handling was suspended and its corresponding reply event, respectively.  Redundant invocations of this method will be ignored.
 | 
			
		||||
- (void)setCurrentAppleEventAndReplyEventWithSuspensionID:(NSAppleEventManagerSuspensionID)suspensionID;
 | 
			
		||||
 | 
			
		||||
// Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, signal that handling of the suspended event may now continue.  This may result in the immediate sending of the reply event to the sender of the suspended event, if the sender has requested a reply.  If the suspension ID has been used in a previous invocation of -setCurrentAppleEventAndReplyEventWithSuspensionID: the effects of that invocation will be completely undone.  Subsequent invocations of other NSAppleEventManager methods using the same suspension ID are invalid.  This method may be invoked in any thread, not just the one in which the corresponding invocation of -suspendCurrentAppleEvent occurred.
 | 
			
		||||
- (void)resumeWithSuspensionID:(NSAppleEventManagerSuspensionID)suspensionID;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,51 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSAppleScript.h
 | 
			
		||||
	Copyright (c) 2002-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@class NSAppleEventDescriptor, NSDictionary<KeyType, ObjectType>, NSString, NSURL;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
// If the result of -initWithContentsOfURL:error:, -compileAndReturnError:, -executeAndReturnError:, or -executeAppleEvent:error:, signals failure (nil, NO, nil, or nil, respectively), a pointer to an autoreleased dictionary is put at the location pointed to by the error parameter.  The error info dictionary may contain entries that use any combination of the following keys, including no entries at all.
 | 
			
		||||
FOUNDATION_EXPORT NSString *const NSAppleScriptErrorMessage API_AVAILABLE(macos(10.2)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString *const NSAppleScriptErrorNumber API_AVAILABLE(macos(10.2)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString *const NSAppleScriptErrorAppName API_AVAILABLE(macos(10.2)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString *const NSAppleScriptErrorBriefMessage API_AVAILABLE(macos(10.2)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString *const NSAppleScriptErrorRange API_AVAILABLE(macos(10.2)) API_UNAVAILABLE(ios, watchos, tvos); // NSValue containing an NSRange
 | 
			
		||||
 | 
			
		||||
@interface NSAppleScript : NSObject<NSCopying> {
 | 
			
		||||
    @private
 | 
			
		||||
    NSString *_source;
 | 
			
		||||
    unsigned int _compiledScriptID;
 | 
			
		||||
    void *_reserved1;
 | 
			
		||||
    void *_reserved2;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Given a URL that locates a script, in either text or compiled form, initialize.  Return nil and a pointer to an error information dictionary if an error occurs.  This is a designated initializer for this class.
 | 
			
		||||
- (nullable instancetype)initWithContentsOfURL:(NSURL *)url error:(NSDictionary<NSString *, id> * _Nullable * _Nullable)errorInfo NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
// Given a string containing the AppleScript source code of a script, initialize.  Return nil if an error occurs.  This is also a designated initializer for this class.
 | 
			
		||||
- (nullable instancetype)initWithSource:(NSString *)source NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
// Return the source code of the script if it is available, nil otherwise.  It is possible for an NSAppleScript that has been instantiated with -initWithContentsOfURL:error: to be a script for which the source code is not available, but is nonetheless executable.
 | 
			
		||||
@property (nullable, readonly, copy) NSString *source;
 | 
			
		||||
 | 
			
		||||
// Return yes if the script is already compiled, no otherwise.
 | 
			
		||||
@property (readonly, getter=isCompiled) BOOL compiled;
 | 
			
		||||
 | 
			
		||||
// Compile the script, if it is not already compiled.  Return yes for success or if the script was already compiled, no and a pointer to an error information dictionary otherwise.
 | 
			
		||||
- (BOOL)compileAndReturnError:(NSDictionary<NSString *, id> * _Nullable * _Nullable)errorInfo;
 | 
			
		||||
 | 
			
		||||
// Execute the script, compiling it first if it is not already compiled.  Return the result of executing the script, or nil and a pointer to an error information dictionary for failure.
 | 
			
		||||
- (NSAppleEventDescriptor *)executeAndReturnError:(NSDictionary<NSString *, id> * _Nullable * _Nullable)errorInfo;
 | 
			
		||||
 | 
			
		||||
// Execute an Apple event in the context of the script, compiling the script first if it is not already compiled.  Return the result of executing the event, or nil and a pointer to an error information dictionary for failure.
 | 
			
		||||
- (NSAppleEventDescriptor *)executeAppleEvent:(NSAppleEventDescriptor *)event error:(NSDictionary<NSString *, id> * _Nullable * _Nullable)errorInfo;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,99 @@
 | 
			
		||||
/*	NSArchiver.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSCoder.h>
 | 
			
		||||
#import <Foundation/NSException.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSData, NSMutableData, NSMutableDictionary, NSMutableArray;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/************		Archiving: Writing	****************/
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use NSKeyedArchiver instead", macos(10.0,10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0))
 | 
			
		||||
@interface NSArchiver : NSCoder {
 | 
			
		||||
@private
 | 
			
		||||
    void		*mdata;
 | 
			
		||||
    void		*pointerTable;
 | 
			
		||||
    void		*stringTable;
 | 
			
		||||
    void		*ids;
 | 
			
		||||
    void		*map;
 | 
			
		||||
    void		*replacementTable;
 | 
			
		||||
    void		*reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (instancetype)initForWritingWithMutableData:(NSMutableData *)mdata NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
    
 | 
			
		||||
@property (readonly, retain) NSMutableData *archiverData;
 | 
			
		||||
 | 
			
		||||
- (void)encodeRootObject:(id)rootObject;
 | 
			
		||||
- (void)encodeConditionalObject:(nullable id)object;
 | 
			
		||||
 | 
			
		||||
+ (NSData *)archivedDataWithRootObject:(id)rootObject;
 | 
			
		||||
 | 
			
		||||
+ (BOOL)archiveRootObject:(id)rootObject toFile:(NSString *)path;
 | 
			
		||||
 | 
			
		||||
- (void)encodeClassName:(NSString *)trueName intoClassName:(NSString *)inArchiveName;
 | 
			
		||||
- (nullable NSString *)classNameEncodedForTrueClassName:(NSString *)trueName;
 | 
			
		||||
 | 
			
		||||
- (void)replaceObject:(id)object withObject:(id)newObject;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/************		Archiving: Reading		****************/
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use NSKeyedUnarchiver instead", macos(10.0,10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0))
 | 
			
		||||
@interface NSUnarchiver : NSCoder {
 | 
			
		||||
@private
 | 
			
		||||
    void *		datax;
 | 
			
		||||
    NSUInteger		cursor;
 | 
			
		||||
    NSZone              *objectZone;
 | 
			
		||||
    NSUInteger		systemVersion;
 | 
			
		||||
    signed char		streamerVersion;
 | 
			
		||||
    char		swap;
 | 
			
		||||
    char		unused1;
 | 
			
		||||
    char		unused2;
 | 
			
		||||
    void		*pointerTable;
 | 
			
		||||
    void		*stringTable;
 | 
			
		||||
    id			classVersions;
 | 
			
		||||
    NSInteger			lastLabel;
 | 
			
		||||
     void		*map;
 | 
			
		||||
    void		*allUnarchivedObjects;
 | 
			
		||||
    id			reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initForReadingWithData:(NSData *)data NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (void)setObjectZone:(nullable NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
 | 
			
		||||
- (nullable NSZone *)objectZone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property (getter=isAtEnd, readonly) BOOL atEnd;
 | 
			
		||||
 | 
			
		||||
@property (readonly) unsigned int systemVersion;
 | 
			
		||||
 | 
			
		||||
+ (nullable id)unarchiveObjectWithData:(NSData *)data;
 | 
			
		||||
+ (nullable id)unarchiveObjectWithFile:(NSString *)path;
 | 
			
		||||
 | 
			
		||||
+ (void)decodeClassName:(NSString *)inArchiveName asClassName:(NSString *)trueName;
 | 
			
		||||
 | 
			
		||||
- (void)decodeClassName:(NSString *)inArchiveName asClassName:(NSString *)trueName;
 | 
			
		||||
 | 
			
		||||
+ (NSString *)classNameDecodedForArchiveClassName:(NSString *)inArchiveName;
 | 
			
		||||
- (NSString *)classNameDecodedForArchiveClassName:(NSString *)inArchiveName;
 | 
			
		||||
 | 
			
		||||
- (void)replaceObject:(id)object withObject:(id)newObject;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/************		Object call back		****************/
 | 
			
		||||
 | 
			
		||||
@interface NSObject (NSArchiverCallback)
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly) Class classForArchiver;
 | 
			
		||||
 | 
			
		||||
- (nullable id)replacementObjectForArchiver:(NSArchiver *)archiver API_DEPRECATED_WITH_REPLACEMENT("replacementObjectForCoder:", macos(10.0,10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,202 @@
 | 
			
		||||
/*	NSArray.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSEnumerator.h>
 | 
			
		||||
#import <Foundation/NSRange.h>
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
#import <Foundation/NSOrderedCollectionDifference.h>
 | 
			
		||||
 | 
			
		||||
@class NSData, NSIndexSet, NSString, NSURL;
 | 
			
		||||
 | 
			
		||||
/****************	Immutable Array		****************/
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger count;
 | 
			
		||||
- (ObjectType)objectAtIndex:(NSUInteger)index;
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithObjects:(const ObjectType _Nonnull [_Nullable])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSArray<ObjectType> (NSExtendedArray)
 | 
			
		||||
 | 
			
		||||
- (NSArray<ObjectType> *)arrayByAddingObject:(ObjectType)anObject;
 | 
			
		||||
- (NSArray<ObjectType> *)arrayByAddingObjectsFromArray:(NSArray<ObjectType> *)otherArray;
 | 
			
		||||
- (NSString *)componentsJoinedByString:(NSString *)separator;
 | 
			
		||||
- (BOOL)containsObject:(ObjectType)anObject;
 | 
			
		||||
@property (readonly, copy) NSString *description;
 | 
			
		||||
- (NSString *)descriptionWithLocale:(nullable id)locale;
 | 
			
		||||
- (NSString *)descriptionWithLocale:(nullable id)locale indent:(NSUInteger)level;
 | 
			
		||||
- (nullable ObjectType)firstObjectCommonWithArray:(NSArray<ObjectType> *)otherArray;
 | 
			
		||||
- (void)getObjects:(ObjectType _Nonnull __unsafe_unretained [_Nonnull])objects range:(NSRange)range NS_SWIFT_UNAVAILABLE("Use 'subarrayWithRange()' instead");
 | 
			
		||||
- (NSUInteger)indexOfObject:(ObjectType)anObject;
 | 
			
		||||
- (NSUInteger)indexOfObject:(ObjectType)anObject inRange:(NSRange)range;
 | 
			
		||||
- (NSUInteger)indexOfObjectIdenticalTo:(ObjectType)anObject;
 | 
			
		||||
- (NSUInteger)indexOfObjectIdenticalTo:(ObjectType)anObject inRange:(NSRange)range;
 | 
			
		||||
- (BOOL)isEqualToArray:(NSArray<ObjectType> *)otherArray;
 | 
			
		||||
@property (nullable, nonatomic, readonly) ObjectType firstObject API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (nullable, nonatomic, readonly) ObjectType lastObject;
 | 
			
		||||
- (NSEnumerator<ObjectType> *)objectEnumerator;
 | 
			
		||||
- (NSEnumerator<ObjectType> *)reverseObjectEnumerator;
 | 
			
		||||
@property (readonly, copy) NSData *sortedArrayHint;
 | 
			
		||||
- (NSArray<ObjectType> *)sortedArrayUsingFunction:(NSInteger (NS_NOESCAPE *)(ObjectType, ObjectType, void * _Nullable))comparator context:(nullable void *)context;
 | 
			
		||||
- (NSArray<ObjectType> *)sortedArrayUsingFunction:(NSInteger (NS_NOESCAPE *)(ObjectType, ObjectType, void * _Nullable))comparator context:(nullable void *)context hint:(nullable NSData *)hint;
 | 
			
		||||
- (NSArray<ObjectType> *)sortedArrayUsingSelector:(SEL)comparator;
 | 
			
		||||
- (NSArray<ObjectType> *)subarrayWithRange:(NSRange)range;
 | 
			
		||||
/* Serializes this instance to the specified URL in the NSPropertyList format (using NSPropertyListXMLFormat_v1_0). For other formats use NSPropertyListSerialization directly. */
 | 
			
		||||
- (BOOL)writeToURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (void)makeObjectsPerformSelector:(SEL)aSelector NS_SWIFT_UNAVAILABLE("Use enumerateObjectsUsingBlock: or a for loop instead");
 | 
			
		||||
- (void)makeObjectsPerformSelector:(SEL)aSelector withObject:(nullable id)argument NS_SWIFT_UNAVAILABLE("Use enumerateObjectsUsingBlock: or a for loop instead");
 | 
			
		||||
 | 
			
		||||
- (NSArray<ObjectType> *)objectsAtIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
 | 
			
		||||
- (ObjectType)objectAtIndexedSubscript:(NSUInteger)idx API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (void)enumerateObjectsUsingBlock:(void (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)enumerateObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)indexOfObjectPassingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSUInteger)indexOfObjectWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSUInteger)indexOfObjectAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (NSIndexSet *)indexesOfObjectsPassingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSIndexSet *)indexesOfObjectsWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSIndexSet *)indexesOfObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (NSArray<ObjectType> *)sortedArrayUsingComparator:(NSComparator NS_NOESCAPE)cmptr API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSArray<ObjectType> *)sortedArrayWithOptions:(NSSortOptions)opts usingComparator:(NSComparator NS_NOESCAPE)cmptr API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSBinarySearchingOptions) {
 | 
			
		||||
	NSBinarySearchingFirstEqual = (1UL << 8),
 | 
			
		||||
	NSBinarySearchingLastEqual = (1UL << 9),
 | 
			
		||||
	NSBinarySearchingInsertionIndex = (1UL << 10),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)indexOfObject:(ObjectType)obj inSortedRange:(NSRange)r options:(NSBinarySearchingOptions)opts usingComparator:(NSComparator NS_NOESCAPE)cmp API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)); // binary search
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSArray<ObjectType> (NSArrayCreation)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)array;
 | 
			
		||||
+ (instancetype)arrayWithObject:(ObjectType)anObject;
 | 
			
		||||
+ (instancetype)arrayWithObjects:(const ObjectType _Nonnull [_Nonnull])objects count:(NSUInteger)cnt;
 | 
			
		||||
+ (instancetype)arrayWithObjects:(ObjectType)firstObj, ... NS_REQUIRES_NIL_TERMINATION;
 | 
			
		||||
+ (instancetype)arrayWithArray:(NSArray<ObjectType> *)array;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithObjects:(ObjectType)firstObj, ... NS_REQUIRES_NIL_TERMINATION;
 | 
			
		||||
- (instancetype)initWithArray:(NSArray<ObjectType> *)array;
 | 
			
		||||
- (instancetype)initWithArray:(NSArray<ObjectType> *)array copyItems:(BOOL)flag;
 | 
			
		||||
 | 
			
		||||
/* Reads array stored in NSPropertyList format from the specified url. */
 | 
			
		||||
- (nullable NSArray<ObjectType> *)initWithContentsOfURL:(NSURL *)url error:(NSError **)error  API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
/* Reads array stored in NSPropertyList format from the specified url. */
 | 
			
		||||
+ (nullable NSArray<ObjectType> *)arrayWithContentsOfURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0)) NS_SWIFT_UNAVAILABLE("Use initializer instead");
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0))
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("NSArray diffing methods are not available in Swift, use Collection.difference(from:) instead")
 | 
			
		||||
@interface NSArray<ObjectType> (NSArrayDiffing)
 | 
			
		||||
 | 
			
		||||
- (NSOrderedCollectionDifference<ObjectType> *)differenceFromArray:(NSArray<ObjectType> *)other withOptions:(NSOrderedCollectionDifferenceCalculationOptions)options usingEquivalenceTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj1, ObjectType obj2))block;
 | 
			
		||||
 | 
			
		||||
- (NSOrderedCollectionDifference<ObjectType> *)differenceFromArray:(NSArray<ObjectType> *)other withOptions:(NSOrderedCollectionDifferenceCalculationOptions)options;
 | 
			
		||||
 | 
			
		||||
// Uses isEqual: to determine the difference between the parameter and the receiver
 | 
			
		||||
- (NSOrderedCollectionDifference<ObjectType> *)differenceFromArray:(NSArray<ObjectType> *)other;
 | 
			
		||||
 | 
			
		||||
- (nullable NSArray<ObjectType> *)arrayByApplyingDifference:(NSOrderedCollectionDifference<ObjectType> *)difference;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSArray<ObjectType> (NSDeprecated)
 | 
			
		||||
 | 
			
		||||
/* This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
- (void)getObjects:(ObjectType _Nonnull __unsafe_unretained [_Nonnull])objects NS_SWIFT_UNAVAILABLE("Use 'as [AnyObject]' instead") API_DEPRECATED("Use -getObjects:range: instead", macos(10.0, 10.13), ios(2.0, 11.0), watchos(2.0, 4.0), tvos(9.0, 11.0));
 | 
			
		||||
 | 
			
		||||
/* These methods are deprecated, and will be marked with API_DEPRECATED in a subsequent release. Use the variants that use errors instead. */
 | 
			
		||||
+ (nullable NSArray<ObjectType> *)arrayWithContentsOfFile:(NSString *)path API_DEPRECATED_WITH_REPLACEMENT("arrayWithContentsOfURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
+ (nullable NSArray<ObjectType> *)arrayWithContentsOfURL:(NSURL *)url API_DEPRECATED_WITH_REPLACEMENT("arrayWithContentsOfURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (nullable NSArray<ObjectType> *)initWithContentsOfFile:(NSString *)path API_DEPRECATED_WITH_REPLACEMENT("initWithContentsOfURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (nullable NSArray<ObjectType> *)initWithContentsOfURL:(NSURL *)url API_DEPRECATED_WITH_REPLACEMENT("initWithContentsOfURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile API_DEPRECATED_WITH_REPLACEMENT("writeToURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (BOOL)writeToURL:(NSURL *)url atomically:(BOOL)atomically API_DEPRECATED_WITH_REPLACEMENT("writeToURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/****************	Mutable Array		****************/
 | 
			
		||||
 | 
			
		||||
@interface NSMutableArray<ObjectType> : NSArray<ObjectType>
 | 
			
		||||
 | 
			
		||||
- (void)addObject:(ObjectType)anObject;
 | 
			
		||||
- (void)insertObject:(ObjectType)anObject atIndex:(NSUInteger)index;
 | 
			
		||||
- (void)removeLastObject;
 | 
			
		||||
- (void)removeObjectAtIndex:(NSUInteger)index;
 | 
			
		||||
- (void)replaceObjectAtIndex:(NSUInteger)index withObject:(ObjectType)anObject;
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithCapacity:(NSUInteger)numItems NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableArray<ObjectType> (NSExtendedMutableArray)
 | 
			
		||||
    
 | 
			
		||||
- (void)addObjectsFromArray:(NSArray<ObjectType> *)otherArray;
 | 
			
		||||
- (void)exchangeObjectAtIndex:(NSUInteger)idx1 withObjectAtIndex:(NSUInteger)idx2;
 | 
			
		||||
- (void)removeAllObjects;
 | 
			
		||||
- (void)removeObject:(ObjectType)anObject inRange:(NSRange)range;
 | 
			
		||||
- (void)removeObject:(ObjectType)anObject;
 | 
			
		||||
- (void)removeObjectIdenticalTo:(ObjectType)anObject inRange:(NSRange)range;
 | 
			
		||||
- (void)removeObjectIdenticalTo:(ObjectType)anObject;
 | 
			
		||||
- (void)removeObjectsFromIndices:(NSUInteger *)indices numIndices:(NSUInteger)cnt API_DEPRECATED("Not supported", macos(10.0,10.6), ios(2.0,4.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (void)removeObjectsInArray:(NSArray<ObjectType> *)otherArray;
 | 
			
		||||
- (void)removeObjectsInRange:(NSRange)range;
 | 
			
		||||
- (void)replaceObjectsInRange:(NSRange)range withObjectsFromArray:(NSArray<ObjectType> *)otherArray range:(NSRange)otherRange;
 | 
			
		||||
- (void)replaceObjectsInRange:(NSRange)range withObjectsFromArray:(NSArray<ObjectType> *)otherArray;
 | 
			
		||||
- (void)setArray:(NSArray<ObjectType> *)otherArray;
 | 
			
		||||
- (void)sortUsingFunction:(NSInteger (NS_NOESCAPE *)(ObjectType,  ObjectType, void * _Nullable))compare context:(nullable void *)context;
 | 
			
		||||
- (void)sortUsingSelector:(SEL)comparator;
 | 
			
		||||
 | 
			
		||||
- (void)insertObjects:(NSArray<ObjectType> *)objects atIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
- (void)removeObjectsAtIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
- (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withObjects:(NSArray<ObjectType> *)objects;
 | 
			
		||||
 | 
			
		||||
- (void)setObject:(ObjectType)obj atIndexedSubscript:(NSUInteger)idx API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (void)sortUsingComparator:(NSComparator NS_NOESCAPE)cmptr API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)sortWithOptions:(NSSortOptions)opts usingComparator:(NSComparator NS_NOESCAPE)cmptr API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableArray<ObjectType> (NSMutableArrayCreation)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)arrayWithCapacity:(NSUInteger)numItems;
 | 
			
		||||
 | 
			
		||||
+ (nullable NSMutableArray<ObjectType> *)arrayWithContentsOfFile:(NSString *)path;
 | 
			
		||||
+ (nullable NSMutableArray<ObjectType> *)arrayWithContentsOfURL:(NSURL *)url;
 | 
			
		||||
- (nullable NSMutableArray<ObjectType> *)initWithContentsOfFile:(NSString *)path;
 | 
			
		||||
- (nullable NSMutableArray<ObjectType> *)initWithContentsOfURL:(NSURL *)url;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0))
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("NSMutableArray diffing methods are not available in Swift")
 | 
			
		||||
@interface NSMutableArray<ObjectType> (NSMutableArrayDiffing)
 | 
			
		||||
 | 
			
		||||
- (void)applyDifference:(NSOrderedCollectionDifference<ObjectType> *)difference;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,341 @@
 | 
			
		||||
/*	NSAttributedString.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSAttributedStringKey NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.0), ios(3.2), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSAttributedString : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *string;
 | 
			
		||||
- (NSDictionary<NSAttributedStringKey, id> *)attributesAtIndex:(NSUInteger)location effectiveRange:(nullable NSRangePointer)range;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSAttributedString (NSExtendedAttributedString)
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger length;
 | 
			
		||||
- (nullable id)attribute:(NSAttributedStringKey)attrName atIndex:(NSUInteger)location effectiveRange:(nullable NSRangePointer)range;
 | 
			
		||||
- (NSAttributedString *)attributedSubstringFromRange:(NSRange)range;
 | 
			
		||||
 | 
			
		||||
- (NSDictionary<NSAttributedStringKey, id> *)attributesAtIndex:(NSUInteger)location longestEffectiveRange:(nullable NSRangePointer)range inRange:(NSRange)rangeLimit;
 | 
			
		||||
- (nullable id)attribute:(NSAttributedStringKey)attrName atIndex:(NSUInteger)location longestEffectiveRange:(nullable NSRangePointer)range inRange:(NSRange)rangeLimit;
 | 
			
		||||
 | 
			
		||||
- (BOOL)isEqualToAttributedString:(NSAttributedString *)other;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithString:(NSString *)str;
 | 
			
		||||
- (instancetype)initWithString:(NSString *)str attributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attrs;
 | 
			
		||||
- (instancetype)initWithAttributedString:(NSAttributedString *)attrStr;
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSAttributedStringEnumerationOptions) {
 | 
			
		||||
  NSAttributedStringEnumerationReverse = (1UL << 1),
 | 
			
		||||
  NSAttributedStringEnumerationLongestEffectiveRangeNotRequired = (1UL << 20)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
- (void)enumerateAttributesInRange:(NSRange)enumerationRange options:(NSAttributedStringEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSDictionary<NSAttributedStringKey, id> *attrs, NSRange range, BOOL *stop))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)enumerateAttribute:(NSAttributedStringKey)attrName inRange:(NSRange)enumerationRange options:(NSAttributedStringEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(id _Nullable value, NSRange range, BOOL *stop))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.0), ios(3.2), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSMutableAttributedString : NSAttributedString
 | 
			
		||||
 | 
			
		||||
- (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)str;
 | 
			
		||||
- (void)setAttributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attrs range:(NSRange)range;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableAttributedString (NSExtendedMutableAttributedString)
 | 
			
		||||
 | 
			
		||||
@property (readonly, retain) NSMutableString *mutableString;
 | 
			
		||||
 | 
			
		||||
- (void)addAttribute:(NSAttributedStringKey)name value:(id)value range:(NSRange)range;
 | 
			
		||||
- (void)addAttributes:(NSDictionary<NSAttributedStringKey, id> *)attrs range:(NSRange)range;
 | 
			
		||||
- (void)removeAttribute:(NSAttributedStringKey)name range:(NSRange)range;
 | 
			
		||||
 | 
			
		||||
- (void)replaceCharactersInRange:(NSRange)range withAttributedString:(NSAttributedString *)attrString;
 | 
			
		||||
- (void)insertAttributedString:(NSAttributedString *)attrString atIndex:(NSUInteger)loc;
 | 
			
		||||
- (void)appendAttributedString:(NSAttributedString *)attrString;
 | 
			
		||||
- (void)deleteCharactersInRange:(NSRange)range;
 | 
			
		||||
- (void)setAttributedString:(NSAttributedString *)attrString;
 | 
			
		||||
 | 
			
		||||
- (void)beginEditing;
 | 
			
		||||
- (void)endEditing;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// Support for Markdown:
 | 
			
		||||
 | 
			
		||||
// Presentation intents correspond to the Markdown constructs applied to a certain range.
 | 
			
		||||
// The system may supply a default presentation for these intents in certain contexts.
 | 
			
		||||
 | 
			
		||||
// Inline presentation intents.
 | 
			
		||||
// For use with NSInlinePresentationAttributeName.
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSInlinePresentationIntent) {
 | 
			
		||||
    NSInlinePresentationIntentEmphasized                   = 1 << 0,
 | 
			
		||||
    NSInlinePresentationIntentStronglyEmphasized           = 1 << 1,
 | 
			
		||||
    NSInlinePresentationIntentCode                         = 1 << 2,
 | 
			
		||||
    NSInlinePresentationIntentStrikethrough                = 1 << 5,
 | 
			
		||||
    NSInlinePresentationIntentSoftBreak                    = 1 << 6,
 | 
			
		||||
    NSInlinePresentationIntentLineBreak                    = 1 << 7,
 | 
			
		||||
    NSInlinePresentationIntentInlineHTML                   = 1 << 8,
 | 
			
		||||
    NSInlinePresentationIntentBlockHTML                    = 1 << 9
 | 
			
		||||
} API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) NS_SWIFT_NAME(InlinePresentationIntent);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// a NSNumber wrapping a value of type NSInlinePresentationIntent
 | 
			
		||||
FOUNDATION_EXTERN const NSAttributedStringKey NSInlinePresentationIntentAttributeName
 | 
			
		||||
 API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) NS_SWIFT_NAME(inlinePresentationIntent);
 | 
			
		||||
 | 
			
		||||
// a NSString
 | 
			
		||||
FOUNDATION_EXTERN const NSAttributedStringKey NSAlternateDescriptionAttributeName
 | 
			
		||||
 API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) NS_SWIFT_NAME(alternateDescription);
 | 
			
		||||
 | 
			
		||||
// a NSURL
 | 
			
		||||
FOUNDATION_EXTERN const NSAttributedStringKey NSImageURLAttributeName
 | 
			
		||||
 API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) NS_SWIFT_NAME(imageURL);
 | 
			
		||||
 | 
			
		||||
// a NSString
 | 
			
		||||
FOUNDATION_EXTERN const NSAttributedStringKey NSLanguageIdentifierAttributeName
 | 
			
		||||
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) NS_SWIFT_NAME(languageIdentifier);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSAttributedStringMarkdownParsingFailurePolicy) {
 | 
			
		||||
    // If parsing fails, return an error from the appropriate constructor.
 | 
			
		||||
    NSAttributedStringMarkdownParsingFailureReturnError = 0,
 | 
			
		||||
 | 
			
		||||
    // If parsing fails, and if possible, return a partial string. It may contain unparsed markup.
 | 
			
		||||
    // Note that if it isn't possible, an error may be returned anyway.
 | 
			
		||||
    NSAttributedStringMarkdownParsingFailureReturnPartiallyParsedIfPossible = 1,
 | 
			
		||||
} API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSAttributedStringMarkdownInterpretedSyntax) {
 | 
			
		||||
    // Interpret the full Markdown syntax and produce all relevant attributes
 | 
			
		||||
    NSAttributedStringMarkdownInterpretedSyntaxFull = 0,
 | 
			
		||||
    
 | 
			
		||||
    // Parse all Markdown text, but interpret only attributes that apply to inline spans. Attributes that differentiate blocks (e.g. NSPresentationIntentAttributeName) will not be applied. (Extended attributes apply to inline spans, if allowed, and will also be interpreted.)
 | 
			
		||||
    NSAttributedStringMarkdownInterpretedSyntaxInlineOnly = 1,
 | 
			
		||||
    
 | 
			
		||||
    // Like …InlineOnly, but do not interpret multiple consecutive instances of whitespace as a single separator space. All whitespace characters will appear in the result as they are specified in the source.
 | 
			
		||||
    NSAttributedStringMarkdownInterpretedSyntaxInlineOnlyPreservingWhitespace = 2
 | 
			
		||||
} API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
NS_REFINED_FOR_SWIFT
 | 
			
		||||
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
 | 
			
		||||
@interface NSAttributedStringMarkdownParsingOptions : NSObject <NSCopying>
 | 
			
		||||
 | 
			
		||||
- (instancetype)init;
 | 
			
		||||
 | 
			
		||||
// Whether to allow parsing extensions to Markdown that specify extended attributes. Defaults to NO (only parse CommonMark syntax).
 | 
			
		||||
@property BOOL allowsExtendedAttributes;
 | 
			
		||||
 | 
			
		||||
// What subset of Markdown syntax will be interpreted to produce relevant attributes in the final result.
 | 
			
		||||
// Excluded syntax will still be parsed, and the text will be included in the final result. However, it will not have attributes applied to it.
 | 
			
		||||
@property NSAttributedStringMarkdownInterpretedSyntax interpretedSyntax;
 | 
			
		||||
 | 
			
		||||
// The policy to apply if the Markdown source triggers a parsing error.
 | 
			
		||||
// The default is NSAttributedStringMarkdownParsingFailureReturnError.
 | 
			
		||||
@property NSAttributedStringMarkdownParsingFailurePolicy failurePolicy;
 | 
			
		||||
 | 
			
		||||
// The BCP-47 language code for this document. If not nil, the NSLanguageAttributeName attribute will be applied to any range in the returned string that doesn't otherwise specify a language attribute.
 | 
			
		||||
// The default is nil, which applies no attributes.
 | 
			
		||||
@property (nullable, copy) NSString *languageCode;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSAttributedString (NSAttributedStringCreateFromMarkdown)
 | 
			
		||||
 | 
			
		||||
// These constructors have a 'baseURL' parameter. If specified, links in the document will be relative to this URL, and images in the document will be looked for relative to this URL (if the other options allow image loading).
 | 
			
		||||
// Defaults to nil. If set to nil, paths will not be resolved.
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithContentsOfMarkdownFileAtURL:(NSURL *)markdownFile
 | 
			
		||||
     options:(nullable NSAttributedStringMarkdownParsingOptions *)options
 | 
			
		||||
     baseURL:(nullable NSURL *)baseURL
 | 
			
		||||
     error:(NSError **)error
 | 
			
		||||
     API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
 | 
			
		||||
     NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithMarkdown:(NSData *)markdown
 | 
			
		||||
     options:(nullable NSAttributedStringMarkdownParsingOptions *)options
 | 
			
		||||
     baseURL:(nullable NSURL *)baseURL
 | 
			
		||||
     error:(NSError **)error
 | 
			
		||||
     API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
 | 
			
		||||
     NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithMarkdownString:(NSString *)markdownString
 | 
			
		||||
     options:(nullable NSAttributedStringMarkdownParsingOptions *)options
 | 
			
		||||
     baseURL:(nullable NSURL *)baseURL
 | 
			
		||||
     error:(NSError **)error
 | 
			
		||||
     API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
 | 
			
		||||
     NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Formatting API:
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSAttributedStringFormattingOptions) {
 | 
			
		||||
    NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging
 | 
			
		||||
      API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) = 1 << 0,
 | 
			
		||||
    NSAttributedStringFormattingApplyReplacementIndexAttribute
 | 
			
		||||
      API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) = 1 << 1,
 | 
			
		||||
} NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
@interface NSAttributedString (NSAttributedStringFormatting)
 | 
			
		||||
 | 
			
		||||
/// Formats the string using the specified locale (or the canonical one, if nil).
 | 
			
		||||
- (instancetype)initWithFormat:(NSAttributedString *)format
 | 
			
		||||
                       options:(NSAttributedStringFormattingOptions)options
 | 
			
		||||
                        locale:(nullable NSLocale *)locale, ...
 | 
			
		||||
    NS_REFINED_FOR_SWIFT
 | 
			
		||||
    API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
/// Formats the string using the arguments list and the specified locale (or the canonical one, if nil).
 | 
			
		||||
- (instancetype)initWithFormat:(NSAttributedString *)format
 | 
			
		||||
                       options:(NSAttributedStringFormattingOptions)options
 | 
			
		||||
                        locale:(nullable NSLocale *)locale
 | 
			
		||||
                     arguments:(va_list)arguments
 | 
			
		||||
    NS_REFINED_FOR_SWIFT
 | 
			
		||||
    API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
/// Formats the string using the current locale and default options.
 | 
			
		||||
+ (instancetype)localizedAttributedStringWithFormat:(NSAttributedString *)format, ...
 | 
			
		||||
    NS_REFINED_FOR_SWIFT
 | 
			
		||||
    API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
/// Formats the string using the current locale and the specified options.
 | 
			
		||||
+ (instancetype)localizedAttributedStringWithFormat:(NSAttributedString *)format
 | 
			
		||||
                                            options:(NSAttributedStringFormattingOptions)options, ...
 | 
			
		||||
    NS_REFINED_FOR_SWIFT
 | 
			
		||||
    API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableAttributedString (NSMutableAttributedStringFormatting)
 | 
			
		||||
 | 
			
		||||
/// Formats the specified string and arguments with the current locale,
 | 
			
		||||
/// then appends the result to the receiver.
 | 
			
		||||
- (void)appendLocalizedFormat:(NSAttributedString *)format, ...
 | 
			
		||||
    NS_REFINED_FOR_SWIFT
 | 
			
		||||
    API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSAttributedStringKey const NSReplacementIndexAttributeName
 | 
			
		||||
    NS_SWIFT_NAME(replacementIndex)
 | 
			
		||||
    API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// -----
 | 
			
		||||
 | 
			
		||||
@interface NSAttributedString (NSMorphology)
 | 
			
		||||
 | 
			
		||||
/// If the string has portions tagged with NSInflectionRuleAttributeName
 | 
			
		||||
/// that have no format specifiers, create a new string with those portions inflected
 | 
			
		||||
/// by following the rule in the attribute.
 | 
			
		||||
- (NSAttributedString *)attributedStringByInflectingString
 | 
			
		||||
    API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSAttributedStringKey const NSMorphologyAttributeName
 | 
			
		||||
    NS_SWIFT_NAME(morphology)
 | 
			
		||||
    API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSAttributedStringKey const NSInflectionRuleAttributeName
 | 
			
		||||
    NS_SWIFT_NAME(inflectionRule)
 | 
			
		||||
    API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSAttributedStringKey const NSInflectionAlternativeAttributeName
 | 
			
		||||
    NS_SWIFT_NAME(inflectionAlternative)
 | 
			
		||||
    API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXTERN
 | 
			
		||||
const NSAttributedStringKey NSPresentationIntentAttributeName API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSPresentationIntentKind) {
 | 
			
		||||
    NSPresentationIntentKindParagraph,
 | 
			
		||||
    NSPresentationIntentKindHeader,
 | 
			
		||||
    NSPresentationIntentKindOrderedList,
 | 
			
		||||
    NSPresentationIntentKindUnorderedList,
 | 
			
		||||
    NSPresentationIntentKindListItem,
 | 
			
		||||
    NSPresentationIntentKindCodeBlock,
 | 
			
		||||
    NSPresentationIntentKindBlockQuote,
 | 
			
		||||
    NSPresentationIntentKindThematicBreak,
 | 
			
		||||
    NSPresentationIntentKindTable,
 | 
			
		||||
    NSPresentationIntentKindTableHeaderRow,
 | 
			
		||||
    NSPresentationIntentKindTableRow,
 | 
			
		||||
    NSPresentationIntentKindTableCell,
 | 
			
		||||
} API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSPresentationIntentTableColumnAlignment) {
 | 
			
		||||
    NSPresentationIntentTableColumnAlignmentLeft,
 | 
			
		||||
    NSPresentationIntentTableColumnAlignmentCenter,
 | 
			
		||||
    NSPresentationIntentTableColumnAlignmentRight,
 | 
			
		||||
} API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
NS_REFINED_FOR_SWIFT
 | 
			
		||||
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
 | 
			
		||||
@interface NSPresentationIntent: NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSPresentationIntentKind intentKind;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property (readonly, nullable, strong) NSPresentationIntent *parentIntent;
 | 
			
		||||
 | 
			
		||||
+ (NSPresentationIntent *)paragraphIntentWithIdentity:(NSInteger)identity nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)headerIntentWithIdentity:(NSInteger)identity level:(NSInteger)level nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)codeBlockIntentWithIdentity:(NSInteger)identity languageHint:(nullable NSString *)languageHint nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)thematicBreakIntentWithIdentity:(NSInteger)identity nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)orderedListIntentWithIdentity:(NSInteger)identity nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)unorderedListIntentWithIdentity:(NSInteger)identity nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)listItemIntentWithIdentity:(NSInteger)identity ordinal:(NSInteger)ordinal nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)blockQuoteIntentWithIdentity:(NSInteger)identity nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)tableIntentWithIdentity:(NSInteger)identity columnCount:(NSInteger)columnCount alignments:(NSArray<NSNumber *> *)alignments nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)tableHeaderRowIntentWithIdentity:(NSInteger)identity nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)tableRowIntentWithIdentity:(NSInteger)identity row:(NSInteger)row nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
+ (NSPresentationIntent *)tableCellIntentWithIdentity:(NSInteger)identity column:(NSInteger)column nestedInsideIntent:(nullable NSPresentationIntent *)parent;
 | 
			
		||||
 | 
			
		||||
/// An integer value which uniquely identifies this intent in the document. Identity disambiguates attributes which apply to contiguous text -- for example, two headers in a row with the same level. It can also be used to track the location in an attributed string of a particular part of a document, even after mutation.
 | 
			
		||||
@property (readonly) NSInteger identity;
 | 
			
		||||
 | 
			
		||||
/// If the intent is not a list, this value is 0.
 | 
			
		||||
@property (readonly) NSInteger ordinal;
 | 
			
		||||
 | 
			
		||||
/// If the intent is not a table, this value is `nil`.
 | 
			
		||||
@property (nullable, readonly) NSArray<NSNumber *> *columnAlignments;
 | 
			
		||||
 | 
			
		||||
/// If the intent is not a table, this value is 0.
 | 
			
		||||
@property (readonly) NSInteger columnCount;
 | 
			
		||||
 | 
			
		||||
/// If the intent is not a header, this value is 0.
 | 
			
		||||
@property (readonly) NSInteger headerLevel;
 | 
			
		||||
 | 
			
		||||
/// If the intent is not a code block, this value is `nil`.
 | 
			
		||||
@property (readonly, nullable, copy) NSString *languageHint;
 | 
			
		||||
 | 
			
		||||
/// The column to which this cell belongs (0-based). If the intent is not a cell, this value is 0.
 | 
			
		||||
@property (readonly) NSInteger column;
 | 
			
		||||
 | 
			
		||||
/// The row to which this cell belongs (0-based). If the intent is not a row, this value is 0. Header rows are always row 0. If the table has more rows, those start at row 1.
 | 
			
		||||
@property (readonly) NSInteger row;
 | 
			
		||||
 | 
			
		||||
/// The indentation level of this intent. Each nested list increases the indentation level by one; all elements within the same list (and not then nested into a child list intent) have the same indentation level.
 | 
			
		||||
/// Text outside list intents has an indentation level of 0.
 | 
			
		||||
@property (readonly) NSInteger indentationLevel;
 | 
			
		||||
 | 
			
		||||
/// Returns `YES` if this intent is equivalent to the other presentation intent. Equivalence is the same as equality except that identity is not taken into account.
 | 
			
		||||
- (BOOL)isEquivalentToPresentationIntent:(NSPresentationIntent *)other;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,26 @@
 | 
			
		||||
/*	NSAutoreleasePool.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
NS_AUTOMATED_REFCOUNT_UNAVAILABLE
 | 
			
		||||
@interface NSAutoreleasePool : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    void	*_token;
 | 
			
		||||
    void	*_reserved3;
 | 
			
		||||
    void	*_reserved2;
 | 
			
		||||
    void	*_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
+ (void)addObject:(id)anObject;
 | 
			
		||||
 | 
			
		||||
- (void)addObject:(id)anObject;
 | 
			
		||||
 | 
			
		||||
- (void)drain;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,91 @@
 | 
			
		||||
/*	NSBackgroundActivityScheduler.h
 | 
			
		||||
	Copyright (c) 2013-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* These values are arguments to the completion handler block for the scheduler. */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSBackgroundActivityResult) {
 | 
			
		||||
    // Indicate that the work for this activity has finished and the next invocation can be scheduled.
 | 
			
		||||
    NSBackgroundActivityResultFinished = 1,
 | 
			
		||||
    
 | 
			
		||||
    // Indicate that the system should defer the remainder of this work for now and reschedule the completion soon. This should be used in response to checking the value of -shouldDefer.
 | 
			
		||||
    NSBackgroundActivityResultDeferred = 2,
 | 
			
		||||
} API_AVAILABLE(macos(10.10)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
typedef void (^NSBackgroundActivityCompletionHandler)(NSBackgroundActivityResult result) API_AVAILABLE(macos(10.10)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 This class provides a Cocoa-level interface to the XPC Activity API (see xpc/activity.h).
 | 
			
		||||
 
 | 
			
		||||
 It is used to schedule maintenance or background kinds of tasks. These activities are run by the OS at a time that best accommodates system-wide factors like energy, thermal conditions, and CPU usage. If you have activities that run at an interval measured in 10s of minutes or more, then use this class to schedule those activities.
 | 
			
		||||
 
 | 
			
		||||
 */
 | 
			
		||||
API_AVAILABLE(macos(10.10)) API_UNAVAILABLE(ios, watchos, tvos)
 | 
			
		||||
@interface NSBackgroundActivityScheduler : NSObject {
 | 
			
		||||
    @private
 | 
			
		||||
    id _private1;
 | 
			
		||||
    id _private2;
 | 
			
		||||
    id _private3;
 | 
			
		||||
    int64_t _flags;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Initialize a new instance of the class. The identifier argument should be a string that remains constant across launches of your application. The system uses the value to keep track of the number of times this activity has run and improve the heuristics for deciding when to run the activity in the future.
 | 
			
		||||
   
 | 
			
		||||
   The string should be a reverse DNS style string, such as "com.mycompany.myapplication.myactivity". nil and zero-length strings are not allowed.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/* The identifier this object was initialized with.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly, copy) NSString *identifier;
 | 
			
		||||
 | 
			
		||||
/* Default value is NSQualityOfServiceBackground. If you upgrade the quality of service above this level, the system will more aggressively schedule this activity. The default value is the recommended value for most activities.
 | 
			
		||||
 */
 | 
			
		||||
@property NSQualityOfService qualityOfService;
 | 
			
		||||
 | 
			
		||||
/* The default value is NO. 
 | 
			
		||||
   If set to YES, then the activity will be rescheduled after finishing at the specified interval.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL repeats;
 | 
			
		||||
 | 
			
		||||
/* If this activity is repeating, then this property describes the average interval of seconds between invocations of this activity.
 | 
			
		||||
   If the activity is not repeating, then this property is the suggested interval of time between scheduling the activity and the invocation of the activity.
 | 
			
		||||
*/
 | 
			
		||||
@property NSTimeInterval interval;
 | 
			
		||||
 | 
			
		||||
/* Specifies the number of seconds before or after the nominal fire date when the activity should be invoked. The nominal fire date is calculated by using the interval combined with the previous fire date or the time when the activity is started. These two properties create a window in time during which the activity may be scheduled.
 | 
			
		||||
 
 | 
			
		||||
   The system will more aggresively schedule the activity as it nears the end of the grace period after the nominal fire date.
 | 
			
		||||
 
 | 
			
		||||
   The default value is 1/2 the interval.
 | 
			
		||||
 */
 | 
			
		||||
@property NSTimeInterval tolerance;
 | 
			
		||||
 | 
			
		||||
/* Begin scheduling the activity. All properties should be setup by this point.
 | 
			
		||||
 
 | 
			
		||||
   The block will be called on a serial background queue appropriate for the level of quality of service specified. The system will automatically use NSProcessInfo's -beginActivityWithOptions:reason: API while invoking the block, choosing options appropriate for the desired quality of service.
 | 
			
		||||
  
 | 
			
		||||
   When you are done with the work, be sure to invoke the completionHandler block given to you as an argument to your block. You can pass in a kind of NSBackgroundActivityResult to indicate if the work has been finished or if you are deferring the rest of the work (see -shouldDefer). If you fail to invoke the completionHandler then your activity will never be rescheduled.
 | 
			
		||||
 
 | 
			
		||||
   When invoking the completionHandler, the system will set the schedule the next invocation. If you want to adjust the properties of your scheduler (e.g., the interval or tolerance), do this before invoking the completion block.
 | 
			
		||||
 */
 | 
			
		||||
- (void)scheduleWithBlock:(void (^)(NSBackgroundActivityCompletionHandler completionHandler))block NS_SWIFT_DISABLE_ASYNC;
 | 
			
		||||
 | 
			
		||||
/* Stop scheduling the activity. Any currently executing block will still complete.
 | 
			
		||||
 */
 | 
			
		||||
- (void)invalidate;
 | 
			
		||||
 | 
			
		||||
/* You can call this method occasionally during execution of your activity to determine if system conditions have changed such that it is no longer a good time to run this activity.
 | 
			
		||||
 
 | 
			
		||||
   If the result of this method is YES, then you should wrap up current state. Once you are done saving your state, invoke the completionHandler block (the argument to your scheduled block) with the NSBackgroundActivityResultDeferred constant. The system will invoke your activity block again at a later, more appropriate time. At that point you can read your state and continue the work.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) BOOL shouldDefer;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,253 @@
 | 
			
		||||
/*	NSBundle.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc.  All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSSet.h>
 | 
			
		||||
#import <Foundation/NSProgress.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSURL, NSError, NSUUID, NSLock, NSNumber;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* Because NSBundle caches allocated instances, subclasses should be prepared
 | 
			
		||||
   to receive an already initialized object back from [super initWithPath:] */
 | 
			
		||||
@interface NSBundle : NSObject
 | 
			
		||||
 | 
			
		||||
/* Methods for creating or retrieving bundle instances. */
 | 
			
		||||
@property (class, readonly, strong) NSBundle *mainBundle;
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)bundleWithPath:(NSString *)path;
 | 
			
		||||
- (nullable instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)bundleWithURL:(NSURL *)url API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (nullable instancetype)initWithURL:(NSURL *)url API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
+ (NSBundle *)bundleForClass:(Class)aClass;
 | 
			
		||||
+ (nullable NSBundle *)bundleWithIdentifier:(NSString *)identifier;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSBundle *> *allBundles;
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSBundle *> *allFrameworks;
 | 
			
		||||
 | 
			
		||||
/* Methods for loading and unloading bundles. */
 | 
			
		||||
- (BOOL)load;
 | 
			
		||||
@property (readonly, getter=isLoaded) BOOL loaded;
 | 
			
		||||
- (BOOL)unload;
 | 
			
		||||
 | 
			
		||||
- (BOOL)preflightAndReturnError:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (BOOL)loadAndReturnError:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Methods for locating various components of a bundle. */
 | 
			
		||||
@property (readonly, copy) NSURL *bundleURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *resourceURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *executableURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (nullable NSURL *)URLForAuxiliaryExecutable:(NSString *)executableName API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *privateFrameworksURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *sharedFrameworksURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *sharedSupportURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *builtInPlugInsURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *appStoreReceiptURL API_AVAILABLE(macos(10.7), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *bundlePath;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *resourcePath;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *executablePath;
 | 
			
		||||
- (nullable NSString *)pathForAuxiliaryExecutable:(NSString *)executableName;
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSString *privateFrameworksPath;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *sharedFrameworksPath;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *sharedSupportPath;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *builtInPlugInsPath;
 | 
			
		||||
 | 
			
		||||
/* Methods for locating bundle resources.  Instance methods locate resources in the bundle indicated by the receiver; class methods take an argument pointing to a bundle on disk.  In the class methods, bundleURL is a URL pointing to the location of a bundle on disk, and may not be nil; bundlePath is the path equivalent of bundleURL, an absolute path pointing to the location of a bundle on disk.  By contrast, subpath is a relative path to a subdirectory inside the relevant global or localized resource directory, and should be nil if the resource file in question is not in a subdirectory.  Where appropriate, localizationName is the name of a .lproj directory in the bundle, minus the .lproj extension; passing nil for localizationName retrieves only global resources, whereas using a method without this argument retrieves both global and localized resources (using the standard localization search algorithm).  */
 | 
			
		||||
 | 
			
		||||
+ (nullable NSURL *)URLForResource:(nullable NSString *)name withExtension:(nullable NSString *)ext subdirectory:(nullable NSString *)subpath inBundleWithURL:(NSURL *)bundleURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (nullable NSArray<NSURL *> *)URLsForResourcesWithExtension:(nullable NSString *)ext subdirectory:(nullable NSString *)subpath inBundleWithURL:(NSURL *)bundleURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (nullable NSURL *)URLForResource:(nullable NSString *)name withExtension:(nullable NSString *)ext API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (nullable NSURL *)URLForResource:(nullable NSString *)name withExtension:(nullable NSString *)ext subdirectory:(nullable NSString *)subpath API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (nullable NSURL *)URLForResource:(nullable NSString *)name withExtension:(nullable NSString *)ext subdirectory:(nullable NSString *)subpath localization:(nullable NSString *)localizationName API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (nullable NSArray<NSURL *> *)URLsForResourcesWithExtension:(nullable NSString *)ext subdirectory:(nullable NSString *)subpath API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (nullable NSArray<NSURL *> *)URLsForResourcesWithExtension:(nullable NSString *)ext subdirectory:(nullable NSString *)subpath localization:(nullable NSString *)localizationName API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
+ (nullable NSString *)pathForResource:(nullable NSString *)name ofType:(nullable NSString *)ext inDirectory:(NSString *)bundlePath;
 | 
			
		||||
+ (NSArray<NSString *> *)pathsForResourcesOfType:(nullable NSString *)ext inDirectory:(NSString *)bundlePath;
 | 
			
		||||
 | 
			
		||||
- (nullable NSString *)pathForResource:(nullable NSString *)name ofType:(nullable NSString *)ext;
 | 
			
		||||
- (nullable NSString *)pathForResource:(nullable NSString *)name ofType:(nullable NSString *)ext inDirectory:(nullable NSString *)subpath;
 | 
			
		||||
- (nullable NSString *)pathForResource:(nullable NSString *)name ofType:(nullable NSString *)ext inDirectory:(nullable NSString *)subpath forLocalization:(nullable NSString *)localizationName;
 | 
			
		||||
 | 
			
		||||
- (NSArray<NSString *> *)pathsForResourcesOfType:(nullable NSString *)ext inDirectory:(nullable NSString *)subpath;
 | 
			
		||||
- (NSArray<NSString *> *)pathsForResourcesOfType:(nullable NSString *)ext inDirectory:(nullable NSString *)subpath forLocalization:(nullable NSString *)localizationName;
 | 
			
		||||
 | 
			
		||||
/* Methods for retrieving localized strings. */
 | 
			
		||||
- (NSString *)localizedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1);
 | 
			
		||||
- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
/* Methods for obtaining various information about a bundle. */
 | 
			
		||||
@property (nullable, readonly, copy) NSString *bundleIdentifier;
 | 
			
		||||
@property (nullable, readonly, copy) NSDictionary<NSString *, id> *infoDictionary;
 | 
			
		||||
@property (nullable, readonly, copy) NSDictionary<NSString *, id> *localizedInfoDictionary;
 | 
			
		||||
- (nullable id)objectForInfoDictionaryKey:(NSString *)key;
 | 
			
		||||
- (nullable Class)classNamed:(NSString *)className;
 | 
			
		||||
@property (nullable, readonly) Class principalClass;
 | 
			
		||||
 | 
			
		||||
/* Methods for dealing with localizations. */
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *preferredLocalizations;	// a subset of this bundle's localizations, re-ordered into the preferred order for this process's current execution environment; the main bundle's preferred localizations indicate the language (of text) the user is most likely seeing in the UI
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *localizations;		// list of language names this bundle appears to be localized to
 | 
			
		||||
@property (nullable, readonly, copy) NSString *developmentLocalization;
 | 
			
		||||
 | 
			
		||||
+ (NSArray<NSString *> *)preferredLocalizationsFromArray:(NSArray<NSString *> *)localizationsArray;
 | 
			
		||||
+ (NSArray<NSString *> *)preferredLocalizationsFromArray:(NSArray<NSString *> *)localizationsArray forPreferences:(nullable NSArray<NSString *> *)preferencesArray;
 | 
			
		||||
 | 
			
		||||
/* Method for determining executable architectures. */
 | 
			
		||||
enum {
 | 
			
		||||
    NSBundleExecutableArchitectureI386      = 0x00000007,
 | 
			
		||||
    NSBundleExecutableArchitecturePPC       = 0x00000012,
 | 
			
		||||
    NSBundleExecutableArchitectureX86_64    = 0x01000007,
 | 
			
		||||
    NSBundleExecutableArchitecturePPC64     = 0x01000012,
 | 
			
		||||
    NSBundleExecutableArchitectureARM64 API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) = 0x0100000c
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSNumber *> *executableArchitectures API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#define NSLocalizedString(key, comment) \
 | 
			
		||||
	    [NSBundle.mainBundle localizedStringForKey:(key) value:@"" table:nil]
 | 
			
		||||
#define NSLocalizedStringFromTable(key, tbl, comment) \
 | 
			
		||||
	    [NSBundle.mainBundle localizedStringForKey:(key) value:@"" table:(tbl)]
 | 
			
		||||
#define NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) \
 | 
			
		||||
	    [bundle localizedStringForKey:(key) value:@"" table:(tbl)]
 | 
			
		||||
#define NSLocalizedStringWithDefaultValue(key, tbl, bundle, val, comment) \
 | 
			
		||||
	    [bundle localizedStringForKey:(key) value:(val) table:(tbl)]
 | 
			
		||||
 | 
			
		||||
#define NSLocalizedAttributedString(key, comment) \
 | 
			
		||||
	    [NSBundle.mainBundle localizedAttributedStringForKey:(key) value:@"" table:nil]
 | 
			
		||||
#define NSLocalizedAttributedStringFromTable(key, tbl, comment) \
 | 
			
		||||
	    [NSBundle.mainBundle localizedAttributedStringForKey:(key) value:@"" table:(tbl)]
 | 
			
		||||
#define NSLocalizedAttributedStringFromTableInBundle(key, tbl, bundle, comment) \
 | 
			
		||||
	    [bundle localizedAttributedStringForKey:(key) value:@"" table:(tbl)]
 | 
			
		||||
#define NSLocalizedAttributedStringWithDefaultValue(key, tbl, bundle, val, comment) \
 | 
			
		||||
	    [bundle localizedAttributedStringForKey:(key) value:(val) table:(tbl)]
 | 
			
		||||
 | 
			
		||||
@interface NSString (NSBundleExtensionMethods)
 | 
			
		||||
 | 
			
		||||
/* For strings with length variations, such as from a stringsdict file, this method returns the variant at the given width. If there is no variant at the given width, the one for the next smaller width is returned. And if there are none smaller, the smallest available is returned. For strings without variations, this method returns self. The unit that width is expressed in is decided by the application or framework. But it is intended to be some measurement indicative of the context a string would fit best to avoid truncation and wasted space.
 | 
			
		||||
*/ 
 | 
			
		||||
- (NSString *)variantFittingPresentationWidth:(NSInteger)width API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSBundleDidLoadNotification;
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSLoadedClasses;	// notification key
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 The NSBundleResourceRequest class is used to interact with the on demand resource loading system.
 | 
			
		||||
 
 | 
			
		||||
 The purpose of the system is to allow an application to download certain resources on demand, when they are required. This also means that the system can purge a resource from disk when it is no longer required, which will save disk space. This class describes which resources are required, makes the request and reports progress, allows the app to specify how long during its execution that they are required.
 | 
			
		||||
 
 | 
			
		||||
 Resources are downloaded into the application container, and are made available via the standard NSBundle resource lookup API.
 | 
			
		||||
 
 | 
			
		||||
 The request object itself is lightweight. You may create as many as you need, for example to request the same set of tags in different components of your application.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(ios(9.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos)
 | 
			
		||||
@interface NSBundleResourceRequest : NSObject <NSProgressReporting>
 | 
			
		||||
 | 
			
		||||
- (instancetype)init API_UNAVAILABLE(macos, ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 A tag and bundle are required arguments to the init methods. The tag argument is required and it must exist in the manifest of the specified bundle. The bundle argument describes an existing bundle which was built with on demand resources support. Any resources downloaded can be found using the standard NSBundle resource lookup API once the request is completed. If no bundle is specified then the main bundle is used.
 | 
			
		||||
 */
 | 
			
		||||
- (instancetype)initWithTags:(NSSet<NSString *> *)tags;
 | 
			
		||||
- (instancetype)initWithTags:(NSSet<NSString *> *)tags bundle:(NSBundle *)bundle NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Provides a hint to the resource loading system as to the loading priority of this request. Values are limited to between 0 and 1, with 1 being the highest priority. The default priority is 0.5.
 | 
			
		||||
 
 | 
			
		||||
 The exact meaning of the value is up to your application. The system will prefer to act on requests that have a higher priority (from the same application). You may change the priority at any time, even after a request has started. The system will make a best attempt to take the new priority into account.
 | 
			
		||||
 */
 | 
			
		||||
@property double loadingPriority;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 The tags this request will load.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly, copy) NSSet<NSString *> *tags;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 The bundle object that will hold the requested resources. After the -beginAccessingResourcesWithCompletionHandler: callback is invoked, you may use the standard bundle lookup APIs on this bundle object to find your resources.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly, strong) NSBundle *bundle;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Ask the system to fetch the resources that were part of the tag set in this request. Resources will not be purged while in use by the application (as indicated by the application using this begin API paired with a call to -endAccessingResources). If an application has too many fetched resources and the system is unable to reserve enough space for newly requested tags, the request may return an error.
 | 
			
		||||
 
 | 
			
		||||
 When you are finished with the resources and they may be purged off the disk, invoke -endAccessingResources. If the request object is deallocated, it will also inform the system that the resources are no longer in use.
 | 
			
		||||
 
 | 
			
		||||
 The completion block will be invoked on a non-main serial queue when the resources are available or an error has occurred. An example of a possible error that may be reported is the lack of a network connection or a problem connecting to the on-demand servers.
 | 
			
		||||
 
 | 
			
		||||
 Fetch requests are reference counted across the application. So if you have two requests outstanding with the same set of tags, each may be used independently without having to know about any global state. However, each NSBundleResourceRequest object may only be used once.
 | 
			
		||||
 
 | 
			
		||||
 If you cancel an outstanding request (via the cancel method on the NSProgress object, or cancelling a parent progress object you have created) the completion handler argument to this method will be called back with an NSUserCancelledError in the NSCocoaErrorDomain.
 | 
			
		||||
 
 | 
			
		||||
 Be sure to always invoke the -endAccessingResources method to balance a call to the begin method, even in the case of an error in the completion handler.
 | 
			
		||||
 
 | 
			
		||||
 If you want to access the resources again, create a new NSBundleResourceRequest object.
 | 
			
		||||
 */
 | 
			
		||||
- (void)beginAccessingResourcesWithCompletionHandler:(void (^)(NSError * _Nullable error))completionHandler;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Inform the system that you wish to begin accessing the resources that are part of this request, but do not attempt to download any content over the network. The completion handler will be invoked with a YES argument if the resources are available.
 | 
			
		||||
 
 | 
			
		||||
 If the resources were available, then you must invoke the -endAccessingResources method once you are done accessing them. If the resources were not available, then you may invoke the -beginAccessingResourcesWithCompletionHandler: method to initiate a download of the resources.
 | 
			
		||||
*/
 | 
			
		||||
- (void)conditionallyBeginAccessingResourcesWithCompletionHandler:(void (^)(BOOL resourcesAvailable))completionHandler;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Informs the system that you are finished with the resources that were part of the tag set in this request. Call this after you no longer need the resources to be available on disk. It is important to invoke this method to make room for newly requested resources. This method may only be invoked if you have received a callback from -beginAccessingResourcesWithCompletionHandler:. To cancel an in-progress request, invoke cancel on the -progress property.
 | 
			
		||||
 */
 | 
			
		||||
- (void)endAccessingResources;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Progress for the request. The progress object will be valid at initialization and begin updating after the -beginAccessingResourcesWithCompletionHandler: method is called.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, strong) NSProgress *progress;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSBundle (NSBundleResourceRequestAdditions)
 | 
			
		||||
 | 
			
		||||
/* Set a preservation priority for tags that are included in this bundle for the On Demand Resources system. Preservation priorities may be between 0.0 and 1.0, with higher values being the last choice for purging by the system. The exact meaning of this value is up to your application as it only has meaning within the set of tags your application uses.
 | 
			
		||||
   
 | 
			
		||||
   The default value is 0.0.
 | 
			
		||||
 
 | 
			
		||||
   This method will throw an exception if the receiver bundle has no on demand resource tag information.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setPreservationPriority:(double)priority forTags:(NSSet<NSString *> *)tags API_AVAILABLE(ios(9.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
 | 
			
		||||
- (double)preservationPriorityForTag:(NSString *)tag API_AVAILABLE(ios(9.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 This notification is posted to the default notification center when the resource request system detects a low disk space condition.
 | 
			
		||||
 
 | 
			
		||||
 If the application is in the background, the system needs more space, and the application does not free up enough in response to the notification then the application may be killed. The application can free up space by calling -endAccessingResources on any outstanding requests. This will inform the system that you are done with those resources and it may purge the content to make room for a new request.
 | 
			
		||||
 
 | 
			
		||||
 Note that this notification may not be the same as low disk space on the system, as applications can have a smaller quota.
 | 
			
		||||
 */
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSBundleResourceRequestLowDiskSpaceNotification API_AVAILABLE(ios(9.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
 | 
			
		||||
 | 
			
		||||
/* Use this value for the loadingPriority property if the user is doing nothing but waiting on the result of this request. The system will dedicate the maximum amount of resources available to finishing this request as soon as possible.
 | 
			
		||||
 */
 | 
			
		||||
FOUNDATION_EXPORT double const NSBundleResourceRequestLoadingPriorityUrgent API_AVAILABLE(ios(9.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,111 @@
 | 
			
		||||
/*	NSByteCountFormatter.h
 | 
			
		||||
	Copyright (c) 2012-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSFormatter.h>
 | 
			
		||||
#import <Foundation/NSMeasurement.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSByteCountFormatterUnits) {
 | 
			
		||||
    // This causes default units appropriate for the platform to be used. Specifying any units explicitly causes just those units to be used in showing the number.
 | 
			
		||||
    NSByteCountFormatterUseDefault      = 0, 
 | 
			
		||||
    //  Specifying any of the following causes the specified units to be used in showing the number.
 | 
			
		||||
    NSByteCountFormatterUseBytes        = 1UL << 0, 
 | 
			
		||||
    NSByteCountFormatterUseKB           = 1UL << 1,
 | 
			
		||||
    NSByteCountFormatterUseMB           = 1UL << 2,
 | 
			
		||||
    NSByteCountFormatterUseGB           = 1UL << 3, 
 | 
			
		||||
    NSByteCountFormatterUseTB           = 1UL << 4, 
 | 
			
		||||
    NSByteCountFormatterUsePB           = 1UL << 5, 
 | 
			
		||||
    NSByteCountFormatterUseEB           = 1UL << 6, 
 | 
			
		||||
    NSByteCountFormatterUseZB           = 1UL << 7, 
 | 
			
		||||
    NSByteCountFormatterUseYBOrHigher   = 0x0FFUL << 8, 
 | 
			
		||||
    // Can use any unit in showing the number.
 | 
			
		||||
    NSByteCountFormatterUseAll          = 0x0FFFFUL 
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSByteCountFormatterCountStyle) {
 | 
			
		||||
    // Specifies display of file or storage byte counts. The actual behavior for this is platform-specific; on OS X 10.8, this uses the decimal style, but that may change over time.
 | 
			
		||||
    NSByteCountFormatterCountStyleFile   = 0,        
 | 
			
		||||
    // Specifies display of memory byte counts. The actual behavior for this is platform-specific; on OS X 10.8, this uses the binary style, but that may change over time.
 | 
			
		||||
    NSByteCountFormatterCountStyleMemory = 1,
 | 
			
		||||
    // The following two allow specifying the number of bytes for KB explicitly. It's better to use one of the above values in most cases.
 | 
			
		||||
    NSByteCountFormatterCountStyleDecimal = 2,    // 1000 bytes are shown as 1 KB
 | 
			
		||||
    NSByteCountFormatterCountStyleBinary  = 3     // 1024 bytes are shown as 1 KB
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSByteCountFormatter : NSFormatter {
 | 
			
		||||
    @private
 | 
			
		||||
    unsigned int _allowedUnits;
 | 
			
		||||
    char _countStyle;
 | 
			
		||||
    BOOL _allowsNonnumericFormatting, _includesUnit, _includesCount, _includesActualByteCount, _adaptive, _zeroPadsFractionDigits;
 | 
			
		||||
    int _formattingContext;
 | 
			
		||||
    int _reserved[5];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Shortcut for converting a byte count into a string without creating an NSByteCountFormatter and an NSNumber. If you need to specify options other than countStyle, create an instance of NSByteCountFormatter first.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSString *)stringFromByteCount:(long long)byteCount countStyle:(NSByteCountFormatterCountStyle)countStyle;
 | 
			
		||||
 | 
			
		||||
/* Convenience method on stringForObjectValue:. Convert a byte count into a string without creating an NSNumber.
 | 
			
		||||
 */
 | 
			
		||||
- (NSString *)stringFromByteCount:(long long)byteCount;
 | 
			
		||||
 | 
			
		||||
/* Formats the value of the given measurement using the given `countStyle`.
 | 
			
		||||
 | 
			
		||||
   Throws an exception if the given measurement's unit does not belong to the `NSUnitInformationStorage` dimension.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSString *)stringFromMeasurement:(NSMeasurement<NSUnitInformationStorage *> *)measurement countStyle:(NSByteCountFormatterCountStyle)countStyle API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
 | 
			
		||||
 | 
			
		||||
/* Formats the value of the given measurement using the receiver's `countStyle`.
 | 
			
		||||
   Converts the measurement to the units allowed by the receiver's `allowedUnits` before formatting; depending on the value of the measurement, this may result in a string which implies an approximate value (e.g. if the measurement is too large to represent in `allowedUnits`, like `1e20 YB` expressed in `NSByteCountFormatterUseBytes`).
 | 
			
		||||
 | 
			
		||||
   Throws an exception if the given measurement's unit does not belong to the `NSUnitInformationStorage` dimension.
 | 
			
		||||
 */
 | 
			
		||||
- (NSString *)stringFromMeasurement:(NSMeasurement<NSUnitInformationStorage *> *)measurement API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
 | 
			
		||||
 | 
			
		||||
/* Formats `obj` as a byte count (if `obj` is an `NSNumber`) or specific byte measurement (if `obj` is an `NSMeasurement`) using the receiver's settings.
 | 
			
		||||
 | 
			
		||||
   Returns `nil` if `obj` is not of the correct class (`NSNumber` or `NSMeasurement`).
 | 
			
		||||
   Throws an exception if `obj` is an `NSMeasurement` whose unit does not belong to the `NSUnitInformationStorage` dimension.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSString *)stringForObjectValue:(nullable id)obj;
 | 
			
		||||
    
 | 
			
		||||
/* Specify the units that can be used in the output. If NSByteCountFormatterUseDefault, uses platform-appropriate settings; otherwise will only use the specified units. This is the default value. Note that ZB and YB cannot be covered by the range of possible values, but you can still choose to use these units to get fractional display ("0.0035 ZB" for instance).
 | 
			
		||||
 */
 | 
			
		||||
@property NSByteCountFormatterUnits allowedUnits;
 | 
			
		||||
 | 
			
		||||
/* Specify how the count is displayed by indicating the number of bytes to be used for kilobyte. The default setting is NSByteCountFormatterFileCount, which is the system specific value for file and storage sizes.
 | 
			
		||||
 */ 
 | 
			
		||||
@property NSByteCountFormatterCountStyle countStyle;
 | 
			
		||||
 | 
			
		||||
/* Choose whether to allow more natural display of some values, such as zero, where it may be displayed as "Zero KB," ignoring all other flags or options (with the exception of NSByteCountFormatterUseBytes, which would generate "Zero bytes"). The result is appropriate for standalone output. Default value is YES. Special handling of certain values such as zero is especially important in some languages, so it's highly recommended that this property be left in its default state.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL allowsNonnumericFormatting;
 | 
			
		||||
 | 
			
		||||
/* Choose whether to include the number or the units in the resulting formatted string. (For example, instead of 723 KB, returns "723" or "KB".) You can call the API twice to get both parts, separately. But note that putting them together yourself via string concatenation may be wrong for some locales; so use this functionality with care.  Both of these values are YES by default.  Setting both to NO will unsurprisingly result in an empty string.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL includesUnit;
 | 
			
		||||
@property BOOL includesCount;
 | 
			
		||||
 | 
			
		||||
/* Choose whether to parenthetically (localized as appropriate) display the actual number of bytes as well, for instance "723 KB (722,842 bytes)".  This will happen only if needed, that is, the first part is already not showing the exact byte count.  If includesUnit or includesCount are NO, then this setting has no effect.  Default value is NO.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL includesActualByteCount;
 | 
			
		||||
 | 
			
		||||
/* Choose the display style. The "adaptive" algorithm is platform specific and uses a different number of fraction digits based on the magnitude (in 10.8: 0 fraction digits for bytes and KB; 1 fraction digits for MB; 2 for GB and above). Otherwise the result always tries to show at least three significant digits, introducing fraction digits as necessary. Default is YES.
 | 
			
		||||
 */
 | 
			
		||||
@property (getter=isAdaptive) BOOL adaptive;
 | 
			
		||||
 | 
			
		||||
/* Choose whether to zero pad fraction digits so a consistent number of fraction digits are displayed, causing updating displays to remain more stable. For instance, if the adaptive algorithm is used, this option formats 1.19 and 1.2 GB as "1.19 GB" and "1.20 GB" respectively, while without the option the latter would be displayed as "1.2 GB". Default value is NO.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL zeroPadsFractionDigits;
 | 
			
		||||
 | 
			
		||||
/* Specify the formatting context for the formatted string. Default is NSFormattingContextUnknown.
 | 
			
		||||
*/
 | 
			
		||||
@property NSFormattingContext formattingContext API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,235 @@
 | 
			
		||||
/*	NSByteOrder.h
 | 
			
		||||
	Copyright (c) 1995-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
#import <CoreFoundation/CFByteOrder.h>
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
    NS_UnknownByteOrder = CFByteOrderUnknown,
 | 
			
		||||
    NS_LittleEndian = CFByteOrderLittleEndian,
 | 
			
		||||
    NS_BigEndian = CFByteOrderBigEndian
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
NS_INLINE long NSHostByteOrder(void) {
 | 
			
		||||
    return CFByteOrderGetCurrent();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned short NSSwapShort(unsigned short inv) {
 | 
			
		||||
    return CFSwapInt16(inv);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned int NSSwapInt(unsigned int inv) {
 | 
			
		||||
    return CFSwapInt32(inv);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned long NSSwapLong(unsigned long inv) {
 | 
			
		||||
#if __LP64__
 | 
			
		||||
    return CFSwapInt64(inv);
 | 
			
		||||
#else
 | 
			
		||||
    return CFSwapInt32(inv);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned long long NSSwapLongLong(unsigned long long inv) {
 | 
			
		||||
    return CFSwapInt64(inv);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned short NSSwapBigShortToHost(unsigned short x) {
 | 
			
		||||
    return CFSwapInt16BigToHost(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned int NSSwapBigIntToHost(unsigned int x) {
 | 
			
		||||
    return CFSwapInt32BigToHost(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned long NSSwapBigLongToHost(unsigned long x) {
 | 
			
		||||
#if __LP64__
 | 
			
		||||
    return CFSwapInt64BigToHost(x);
 | 
			
		||||
#else
 | 
			
		||||
    return CFSwapInt32BigToHost(x);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned long long NSSwapBigLongLongToHost(unsigned long long x) {
 | 
			
		||||
    return CFSwapInt64BigToHost(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned short NSSwapHostShortToBig(unsigned short x) {
 | 
			
		||||
    return CFSwapInt16HostToBig(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned int NSSwapHostIntToBig(unsigned int x) {
 | 
			
		||||
    return CFSwapInt32HostToBig(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned long NSSwapHostLongToBig(unsigned long x) {
 | 
			
		||||
#if __LP64__
 | 
			
		||||
    return CFSwapInt64HostToBig(x);
 | 
			
		||||
#else
 | 
			
		||||
    return CFSwapInt32HostToBig(x);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned long long NSSwapHostLongLongToBig(unsigned long long x) {
 | 
			
		||||
    return CFSwapInt64HostToBig(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned short NSSwapLittleShortToHost(unsigned short x) {
 | 
			
		||||
    return CFSwapInt16LittleToHost(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned int NSSwapLittleIntToHost(unsigned int x) {
 | 
			
		||||
    return CFSwapInt32LittleToHost(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned long NSSwapLittleLongToHost(unsigned long x) {
 | 
			
		||||
#if __LP64__
 | 
			
		||||
    return CFSwapInt64LittleToHost(x);
 | 
			
		||||
#else
 | 
			
		||||
    return CFSwapInt32LittleToHost(x);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned long long NSSwapLittleLongLongToHost(unsigned long long x) {
 | 
			
		||||
    return CFSwapInt64LittleToHost(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned short NSSwapHostShortToLittle(unsigned short x) {
 | 
			
		||||
    return CFSwapInt16HostToLittle(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned int NSSwapHostIntToLittle(unsigned int x) {
 | 
			
		||||
    return CFSwapInt32HostToLittle(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned long NSSwapHostLongToLittle(unsigned long x) {
 | 
			
		||||
#if __LP64__
 | 
			
		||||
    return CFSwapInt64HostToLittle(x);
 | 
			
		||||
#else
 | 
			
		||||
    return CFSwapInt32HostToLittle(x);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE unsigned long long NSSwapHostLongLongToLittle(unsigned long long x) {
 | 
			
		||||
    return CFSwapInt64HostToLittle(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef struct {unsigned int v;} NSSwappedFloat;
 | 
			
		||||
typedef struct {unsigned long long v;} NSSwappedDouble;
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedFloat NSConvertHostFloatToSwapped(float x) {
 | 
			
		||||
    union fconv {
 | 
			
		||||
	float number;
 | 
			
		||||
	NSSwappedFloat sf;
 | 
			
		||||
    };
 | 
			
		||||
    return ((union fconv *)&x)->sf;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE float NSConvertSwappedFloatToHost(NSSwappedFloat x) {
 | 
			
		||||
    union fconv {
 | 
			
		||||
	float number;
 | 
			
		||||
	NSSwappedFloat sf;
 | 
			
		||||
    };
 | 
			
		||||
    return ((union fconv *)&x)->number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedDouble NSConvertHostDoubleToSwapped(double x) {
 | 
			
		||||
    union dconv {
 | 
			
		||||
	double number;
 | 
			
		||||
	NSSwappedDouble sd;
 | 
			
		||||
    };
 | 
			
		||||
    return ((union dconv *)&x)->sd;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE double NSConvertSwappedDoubleToHost(NSSwappedDouble x) {
 | 
			
		||||
    union dconv {
 | 
			
		||||
	double number;
 | 
			
		||||
	NSSwappedDouble sd;
 | 
			
		||||
    };
 | 
			
		||||
    return ((union dconv *)&x)->number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedFloat NSSwapFloat(NSSwappedFloat x) {
 | 
			
		||||
    x.v = NSSwapInt(x.v);
 | 
			
		||||
    return x;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedDouble NSSwapDouble(NSSwappedDouble x) {
 | 
			
		||||
    x.v = NSSwapLongLong(x.v);
 | 
			
		||||
    return x;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(__BIG_ENDIAN__)
 | 
			
		||||
 | 
			
		||||
NS_INLINE double NSSwapBigDoubleToHost(NSSwappedDouble x) {
 | 
			
		||||
    return NSConvertSwappedDoubleToHost(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE float NSSwapBigFloatToHost(NSSwappedFloat x) {
 | 
			
		||||
    return NSConvertSwappedFloatToHost(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedDouble NSSwapHostDoubleToBig(double x) {
 | 
			
		||||
    return NSConvertHostDoubleToSwapped(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedFloat NSSwapHostFloatToBig(float x) {
 | 
			
		||||
    return NSConvertHostFloatToSwapped(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE double NSSwapLittleDoubleToHost(NSSwappedDouble x) {
 | 
			
		||||
    return NSConvertSwappedDoubleToHost(NSSwapDouble(x));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE float NSSwapLittleFloatToHost(NSSwappedFloat x) {
 | 
			
		||||
    return NSConvertSwappedFloatToHost(NSSwapFloat(x));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedDouble NSSwapHostDoubleToLittle(double x) {
 | 
			
		||||
    return NSSwapDouble(NSConvertHostDoubleToSwapped(x));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedFloat NSSwapHostFloatToLittle(float x) {
 | 
			
		||||
    return NSSwapFloat(NSConvertHostFloatToSwapped(x));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#elif defined(__LITTLE_ENDIAN__)
 | 
			
		||||
 | 
			
		||||
NS_INLINE double NSSwapBigDoubleToHost(NSSwappedDouble x) {
 | 
			
		||||
    return NSConvertSwappedDoubleToHost(NSSwapDouble(x));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE float NSSwapBigFloatToHost(NSSwappedFloat x) {
 | 
			
		||||
    return NSConvertSwappedFloatToHost(NSSwapFloat(x));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedDouble NSSwapHostDoubleToBig(double x) {
 | 
			
		||||
    return NSSwapDouble(NSConvertHostDoubleToSwapped(x));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedFloat NSSwapHostFloatToBig(float x) {
 | 
			
		||||
    return NSSwapFloat(NSConvertHostFloatToSwapped(x));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE double NSSwapLittleDoubleToHost(NSSwappedDouble x) {
 | 
			
		||||
    return NSConvertSwappedDoubleToHost(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE float NSSwapLittleFloatToHost(NSSwappedFloat x) {
 | 
			
		||||
    return NSConvertSwappedFloatToHost(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedDouble NSSwapHostDoubleToLittle(double x) {
 | 
			
		||||
    return NSConvertHostDoubleToSwapped(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSwappedFloat NSSwapHostFloatToLittle(float x) {
 | 
			
		||||
    return NSConvertHostFloatToSwapped(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
#error Do not know the endianess of this architecture
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,42 @@
 | 
			
		||||
/*      NSCache.h
 | 
			
		||||
        Copyright (c) 2008-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSString;
 | 
			
		||||
@protocol NSCacheDelegate;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSCache <KeyType, ObjectType> : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    id _delegate;
 | 
			
		||||
    void *_private[5];
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (copy) NSString *name;
 | 
			
		||||
 | 
			
		||||
@property (nullable, assign) id<NSCacheDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
- (nullable ObjectType)objectForKey:(KeyType)key;
 | 
			
		||||
- (void)setObject:(ObjectType)obj forKey:(KeyType)key; // 0 cost
 | 
			
		||||
- (void)setObject:(ObjectType)obj forKey:(KeyType)key cost:(NSUInteger)g;
 | 
			
		||||
- (void)removeObjectForKey:(KeyType)key;
 | 
			
		||||
 | 
			
		||||
- (void)removeAllObjects;
 | 
			
		||||
 | 
			
		||||
@property NSUInteger totalCostLimit;	// limits are imprecise/not strict
 | 
			
		||||
@property NSUInteger countLimit;	// limits are imprecise/not strict
 | 
			
		||||
@property BOOL evictsObjectsWithDiscardedContent;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSCacheDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
- (void)cache:(NSCache *)cache willEvictObject:(id)obj;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,476 @@
 | 
			
		||||
/*	NSCalendar.h
 | 
			
		||||
	Copyright (c) 2004-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSRange.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
#include <CoreFoundation/CFCalendar.h>
 | 
			
		||||
 | 
			
		||||
@class NSDateComponents, NSLocale, NSTimeZone, NSString, NSArray<ObjectType>;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
#if !defined(NS_CALENDAR_ENUM_DEPRECATED)
 | 
			
		||||
#if 1 || NS_ENABLE_CALENDAR_DEPRECATIONS
 | 
			
		||||
#define NS_CALENDAR_ENUM_DEPRECATED(A, B, C, D, ...) NS_ENUM_DEPRECATED(A, B, C, D, __VA_ARGS__)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED(A, B, C, D, ...) NS_DEPRECATED(A, B, C, D, __VA_ARGS__)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED_MAC(A, B, ...) NS_DEPRECATED_MAC(A, B, __VA_ARGS__)
 | 
			
		||||
#else
 | 
			
		||||
#define NS_CALENDAR_ENUM_DEPRECATED(A, B, C, D, ...) NS_ENUM_AVAILABLE(A, C)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED(A, B, C, D, ...) NS_AVAILABLE(A, C)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED_MAC(A, B, ...) NS_AVAILABLE_MAC(A)
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSCalendarIdentifier NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierGregorian  API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)); // the common calendar in Europe, the Western Hemisphere, and elsewhere
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierBuddhist            API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierChinese             API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierCoptic              API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierEthiopicAmeteMihret API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierEthiopicAmeteAlem   API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierHebrew              API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierISO8601             API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierIndian              API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierIslamic             API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierIslamicCivil        API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierJapanese            API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierPersian             API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierRepublicOfChina     API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
// A simple tabular Islamic calendar using the astronomical/Thursday epoch of CE 622 July 15
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierIslamicTabular      API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
// The Islamic Umm al-Qura calendar used in Saudi Arabia. This is based on astronomical calculation, instead of tabular behavior.
 | 
			
		||||
FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierIslamicUmmAlQura    API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSCalendarUnit) {
 | 
			
		||||
        NSCalendarUnitEra                = kCFCalendarUnitEra,
 | 
			
		||||
        NSCalendarUnitYear               = kCFCalendarUnitYear,
 | 
			
		||||
        NSCalendarUnitMonth              = kCFCalendarUnitMonth,
 | 
			
		||||
        NSCalendarUnitDay                = kCFCalendarUnitDay,
 | 
			
		||||
        NSCalendarUnitHour               = kCFCalendarUnitHour,
 | 
			
		||||
        NSCalendarUnitMinute             = kCFCalendarUnitMinute,
 | 
			
		||||
        NSCalendarUnitSecond             = kCFCalendarUnitSecond,
 | 
			
		||||
        NSCalendarUnitWeekday            = kCFCalendarUnitWeekday,
 | 
			
		||||
        NSCalendarUnitWeekdayOrdinal     = kCFCalendarUnitWeekdayOrdinal,
 | 
			
		||||
        NSCalendarUnitQuarter            API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = kCFCalendarUnitQuarter,
 | 
			
		||||
        NSCalendarUnitWeekOfMonth        API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)) = kCFCalendarUnitWeekOfMonth,
 | 
			
		||||
        NSCalendarUnitWeekOfYear         API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)) = kCFCalendarUnitWeekOfYear,
 | 
			
		||||
        NSCalendarUnitYearForWeekOfYear  API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)) = kCFCalendarUnitYearForWeekOfYear,
 | 
			
		||||
        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,
 | 
			
		||||
};
 | 
			
		||||
    
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSCalendarOptions) {
 | 
			
		||||
	NSCalendarWrapComponents = (1UL << 0), // option for arithmetic operations that do calendar addition
 | 
			
		||||
 | 
			
		||||
	NSCalendarMatchStrictly    API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = (1ULL << 1),
 | 
			
		||||
	NSCalendarSearchBackwards  API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = (1ULL << 2),
 | 
			
		||||
    
 | 
			
		||||
	NSCalendarMatchPreviousTimePreservingSmallerUnits API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = (1ULL << 8),
 | 
			
		||||
	NSCalendarMatchNextTimePreservingSmallerUnits     API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = (1ULL << 9),
 | 
			
		||||
	NSCalendarMatchNextTime                           API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = (1ULL << 10),
 | 
			
		||||
    
 | 
			
		||||
	NSCalendarMatchFirst  API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = (1ULL << 12),
 | 
			
		||||
	NSCalendarMatchLast   API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = (1ULL << 13)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
	NSWrapCalendarComponents API_DEPRECATED_WITH_REPLACEMENT("NSCalendarWrapComponents", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSCalendarWrapComponents,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSCalendar : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, copy) NSCalendar *currentCalendar;					// user's preferred calendar
 | 
			
		||||
@property (class, readonly, strong) NSCalendar *autoupdatingCurrentCalendar API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)); // tracks changes to user's preferred calendar identifier
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This method returns a new autoreleased calendar object of the given type, specified by a calendar identifier constant.
 | 
			
		||||
	The calendar defaults to having the current locale and default time zone, for those properties.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSCalendar *)calendarWithIdentifier:(NSCalendarIdentifier)calendarIdentifierConstant API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (instancetype)init API_UNAVAILABLE(macos, ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
- (nullable id)initWithCalendarIdentifier:(NSCalendarIdentifier)ident NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSCalendarIdentifier calendarIdentifier;
 | 
			
		||||
@property (nullable, copy) NSLocale *locale;
 | 
			
		||||
@property (copy) NSTimeZone *timeZone;
 | 
			
		||||
@property NSUInteger firstWeekday;
 | 
			
		||||
@property NSUInteger minimumDaysInFirstWeek;
 | 
			
		||||
 | 
			
		||||
// Methods to return component name strings localized to the calendar's locale
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *eraSymbols      API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *longEraSymbols  API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *monthSymbols                    API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *shortMonthSymbols               API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *veryShortMonthSymbols           API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *standaloneMonthSymbols          API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *shortStandaloneMonthSymbols     API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *veryShortStandaloneMonthSymbols API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *weekdaySymbols                    API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *shortWeekdaySymbols               API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *veryShortWeekdaySymbols           API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *standaloneWeekdaySymbols          API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *shortStandaloneWeekdaySymbols     API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *veryShortStandaloneWeekdaySymbols API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *quarterSymbols                 API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *shortQuarterSymbols            API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *standaloneQuarterSymbols       API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *shortStandaloneQuarterSymbols  API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *AMSymbol  API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSString *PMSymbol  API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Calendrical calculations
 | 
			
		||||
 | 
			
		||||
- (NSRange)minimumRangeOfUnit:(NSCalendarUnit)unit;
 | 
			
		||||
- (NSRange)maximumRangeOfUnit:(NSCalendarUnit)unit;
 | 
			
		||||
 | 
			
		||||
- (NSRange)rangeOfUnit:(NSCalendarUnit)smaller inUnit:(NSCalendarUnit)larger forDate:(NSDate *)date;
 | 
			
		||||
- (NSUInteger)ordinalityOfUnit:(NSCalendarUnit)smaller inUnit:(NSCalendarUnit)larger forDate:(NSDate *)date;
 | 
			
		||||
 | 
			
		||||
- (BOOL)rangeOfUnit:(NSCalendarUnit)unit startDate:(NSDate * _Nullable * _Nullable)datep interval:(nullable NSTimeInterval *)tip forDate:(NSDate *)date API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (nullable NSDate *)dateFromComponents:(NSDateComponents *)comps;
 | 
			
		||||
- (NSDateComponents *)components:(NSCalendarUnit)unitFlags fromDate:(NSDate *)date;
 | 
			
		||||
 | 
			
		||||
- (nullable NSDate *)dateByAddingComponents:(NSDateComponents *)comps toDate:(NSDate *)date options:(NSCalendarOptions)opts;
 | 
			
		||||
 | 
			
		||||
- (NSDateComponents *)components:(NSCalendarUnit)unitFlags fromDate:(NSDate *)startingDate toDate:(NSDate *)resultDate options:(NSCalendarOptions)opts;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API is a convenience for getting era, year, month, and day of a given date.
 | 
			
		||||
	Pass NULL for a NSInteger pointer parameter if you don't care about that value.
 | 
			
		||||
*/
 | 
			
		||||
- (void)getEra:(out nullable NSInteger *)eraValuePointer year:(out nullable NSInteger *)yearValuePointer month:(out nullable NSInteger *)monthValuePointer day:(out nullable NSInteger *)dayValuePointer fromDate:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API is a convenience for getting era, year for week-of-year calculations, week of year, and weekday of a given date.
 | 
			
		||||
	Pass NULL for a NSInteger pointer parameter if you don't care about that value.
 | 
			
		||||
*/
 | 
			
		||||
- (void)getEra:(out nullable NSInteger *)eraValuePointer yearForWeekOfYear:(out nullable NSInteger *)yearValuePointer weekOfYear:(out nullable NSInteger *)weekValuePointer weekday:(out nullable NSInteger *)weekdayValuePointer fromDate:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API is a convenience for getting hour, minute, second, and nanoseconds of a given date.
 | 
			
		||||
	Pass NULL for a NSInteger pointer parameter if you don't care about that value.
 | 
			
		||||
*/
 | 
			
		||||
- (void)getHour:(out nullable NSInteger *)hourValuePointer minute:(out nullable NSInteger *)minuteValuePointer second:(out nullable NSInteger *)secondValuePointer nanosecond:(out nullable NSInteger *)nanosecondValuePointer fromDate:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	Get just one component's value.
 | 
			
		||||
*/
 | 
			
		||||
- (NSInteger)component:(NSCalendarUnit)unit fromDate:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	Create a date with given components.
 | 
			
		||||
	Current era is assumed.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSDate *)dateWithEra:(NSInteger)eraValue year:(NSInteger)yearValue month:(NSInteger)monthValue day:(NSInteger)dayValue hour:(NSInteger)hourValue minute:(NSInteger)minuteValue second:(NSInteger)secondValue nanosecond:(NSInteger)nanosecondValue API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	Create a date with given components.
 | 
			
		||||
	Current era is assumed.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSDate *)dateWithEra:(NSInteger)eraValue yearForWeekOfYear:(NSInteger)yearValue weekOfYear:(NSInteger)weekValue weekday:(NSInteger)weekdayValue hour:(NSInteger)hourValue minute:(NSInteger)minuteValue second:(NSInteger)secondValue nanosecond:(NSInteger)nanosecondValue API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API returns the first moment date of a given date.
 | 
			
		||||
	Pass in [NSDate date], for example, if you want the start of "today".
 | 
			
		||||
	If there were two midnights, it returns the first.  If there was none, it returns the first moment that did exist.
 | 
			
		||||
*/
 | 
			
		||||
- (NSDate *)startOfDayForDate:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API returns all the date components of a date, as if in a given time zone (instead of the receiving calendar's time zone).
 | 
			
		||||
	The time zone overrides the time zone of the NSCalendar for the purposes of this calculation.
 | 
			
		||||
	Note: if you want "date information in a given time zone" in order to display it, you should use NSDateFormatter to format the date.
 | 
			
		||||
*/
 | 
			
		||||
- (NSDateComponents *)componentsInTimeZone:(NSTimeZone *)timezone fromDate:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API compares the given dates down to the given unit, reporting them equal if they are the same in the given unit and all larger units, otherwise either less than or greater than.
 | 
			
		||||
*/
 | 
			
		||||
- (NSComparisonResult)compareDate:(NSDate *)date1 toDate:(NSDate *)date2 toUnitGranularity:(NSCalendarUnit)unit API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API compares the given dates down to the given unit, reporting them equal if they are the same in the given unit and all larger units.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)isDate:(NSDate *)date1 equalToDate:(NSDate *)date2 toUnitGranularity:(NSCalendarUnit)unit API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API compares the Days of the given dates, reporting them equal if they are in the same Day.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)isDate:(NSDate *)date1 inSameDayAsDate:(NSDate *)date2 API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API reports if the date is within "today".
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)isDateInToday:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API reports if the date is within "yesterday".
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)isDateInYesterday:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API reports if the date is within "tomorrow".
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)isDateInTomorrow:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API reports if the date is within a weekend period, as defined by the calendar and calendar's locale.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)isDateInWeekend:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	Find the range of the weekend around the given date, returned via two by-reference parameters.
 | 
			
		||||
	Returns NO if the given date is not in a weekend.
 | 
			
		||||
	Note that a given entire Day within a calendar is not necessarily all in a weekend or not; weekends can start in the middle of a Day in some calendars and locales.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)rangeOfWeekendStartDate:(out NSDate * _Nullable * _Nullable)datep interval:(out nullable NSTimeInterval *)tip containingDate:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	Returns the range of the next weekend, via two by-reference parameters, which starts strictly after the given date.
 | 
			
		||||
	The NSCalendarSearchBackwards option can be used to find the previous weekend range strictly before the date.
 | 
			
		||||
	Returns NO if there are no such things as weekend in the calendar and its locale.
 | 
			
		||||
	Note that a given entire Day within a calendar is not necessarily all in a weekend or not; weekends can start in the middle of a Day in some calendars and locales.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)nextWeekendStartDate:(out NSDate * _Nullable * _Nullable)datep interval:(out nullable NSTimeInterval *)tip options:(NSCalendarOptions)options afterDate:(NSDate *)date API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
	This API returns the difference between two dates specified as date components.
 | 
			
		||||
	For units which are not specified in each NSDateComponents, but required to specify an absolute date, the base value of the unit is assumed.  For example, for an NSDateComponents with just a Year and a Month specified, a Day of 1, and an Hour, Minute, Second, and Nanosecond of 0 are assumed.
 | 
			
		||||
	Calendrical calculations with unspecified Year or Year value prior to the start of a calendar are not advised.
 | 
			
		||||
	For each date components object, if its time zone property is set, that time zone is used for it; if the calendar property is set, that is used rather than the receiving calendar, and if both the calendar and time zone are set, the time zone property value overrides the time zone of the calendar property.
 | 
			
		||||
	No options are currently defined; pass 0.
 | 
			
		||||
*/
 | 
			
		||||
- (NSDateComponents *)components:(NSCalendarUnit)unitFlags fromDateComponents:(NSDateComponents *)startingDateComp toDateComponents:(NSDateComponents *)resultDateComp options:(NSCalendarOptions)options API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API returns a new NSDate object representing the date calculated by adding an amount of a specific component to a given date.
 | 
			
		||||
	The NSCalendarWrapComponents option specifies if the component should be incremented and wrap around to zero/one on overflow, and should not cause higher units to be incremented.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSDate *)dateByAddingUnit:(NSCalendarUnit)unit value:(NSInteger)value toDate:(NSDate *)date options:(NSCalendarOptions)options API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This method computes the dates which match (or most closely match) a given set of components, and calls the block once for each of them, until the enumeration is stopped.
 | 
			
		||||
	There will be at least one intervening date which does not match all the components (or the given date itself must not match) between the given date and any result.
 | 
			
		||||
	If the NSCalendarSearchBackwards option is used, this method finds the previous match before the given date.  The intent is that the same matches as for a forwards search will be found (that is, if you are enumerating forwards or backwards for each hour with minute "27", the seconds in the date you will get in forwards search would obviously be 00, and the same will be true in a backwards search in order to implement this rule.  Similarly for DST backwards jumps which repeats times, you'll get the first match by default, where "first" is defined from the point of view of searching forwards.  So, when searching backwards looking for a particular hour, with no minute and second specified, you don't get a minute and second of 59:59 for the matching hour (which would be the nominal first match within a given hour, given the other rules here, when searching backwards).
 | 
			
		||||
	If the NSCalendarMatchStrictly option is used, the algorithm travels as far forward or backward as necessary looking for a match, but there are ultimately implementation-defined limits in how far distant the search will go.  If the NSCalendarMatchStrictly option is not specified, the algorithm searches up to the end of the next instance of the next higher unit to the highest specified unit in the NSDateComponents argument.  If you want to find the next Feb 29 in the Gregorian calendar, for example, you have to specify the NSCalendarMatchStrictly option to guarantee finding it.
 | 
			
		||||
	If an exact match is not possible, and requested with the NSCalendarMatchStrictly option, nil is passed to the block and the enumeration ends.  (Logically, since an exact match searches indefinitely into the future, if no match is found there's no point in continuing the enumeration.)
 | 
			
		||||
 | 
			
		||||
	If the NSCalendarMatchStrictly option is NOT used, exactly one option from the set {NSCalendarMatchPreviousTimePreservingSmallerUnits, NSCalendarMatchNextTimePreservingSmallerUnits, NSCalendarMatchNextTime} must be specified, or an illegal argument exception will be thrown.
 | 
			
		||||
	
 | 
			
		||||
        If the NSCalendarMatchPreviousTimePreservingSmallerUnits option is specified, and there is no matching time before the end of the next instance of the next higher unit to the highest specified unit in the NSDateComponents argument, the method will return the previous existing value of the missing unit and preserves the lower units' values (e.g., no 2:37am results in 1:37am, if that exists).
 | 
			
		||||
	
 | 
			
		||||
        If the NSCalendarMatchNextTimePreservingSmallerUnits option is specified, and there is no matching time before the end of the next instance of the next higher unit to the highest specified unit in the NSDateComponents argument, the method will return the next existing value of the missing unit and preserves the lower units' values (e.g., no 2:37am results in 3:37am, if that exists).
 | 
			
		||||
 
 | 
			
		||||
	If the NSCalendarMatchNextTime option is specified, and there is no matching time before the end of the next instance of the next higher unit to the highest specified unit in the NSDateComponents argument, the method will return the next existing time which exists (e.g., no 2:37am results in 3:00am, if that exists).
 | 
			
		||||
	If the NSCalendarMatchFirst option is specified, and there are two or more matching times (all the components are the same, including isLeapMonth) before the end of the next instance of the next higher unit to the highest specified unit in the NSDateComponents argument, the method will return the first occurrence.
 | 
			
		||||
	If the NSCalendarMatchLast option is specified, and there are two or more matching times (all the components are the same, including isLeapMonth) before the end of the next instance of the next higher unit to the highest specified unit in the NSDateComponents argument, the method will return the last occurrence.
 | 
			
		||||
	If neither the NSCalendarMatchFirst or NSCalendarMatchLast option is specified, the default behavior is to act as if NSCalendarMatchFirst was specified.
 | 
			
		||||
	There is no option to return middle occurrences of more than two occurrences of a matching time, if such exist.
 | 
			
		||||
 | 
			
		||||
	Result dates have an integer number of seconds (as if 0 was specified for the nanoseconds property of the NSDateComponents matching parameter), unless a value was set in the nanoseconds property, in which case the result date will have that number of nanoseconds (or as close as possible with floating point numbers).
 | 
			
		||||
	The enumeration is stopped by setting *stop = YES in the block and return.  It is not necessary to set *stop to NO to keep the enumeration going.
 | 
			
		||||
*/
 | 
			
		||||
- (void)enumerateDatesStartingAfterDate:(NSDate *)start matchingComponents:(NSDateComponents *)comps options:(NSCalendarOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSDate * _Nullable date, BOOL exactMatch, BOOL *stop))block API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This method computes the next date which matches (or most closely matches) a given set of components.
 | 
			
		||||
	The general semantics follow those of the -enumerateDatesStartingAfterDate:... method above.
 | 
			
		||||
	To compute a sequence of results, use the -enumerateDatesStartingAfterDate:... method above, rather than looping and calling this method with the previous loop iteration's result.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSDate *)nextDateAfterDate:(NSDate *)date matchingComponents:(NSDateComponents *)comps options:(NSCalendarOptions)options API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API returns a new NSDate object representing the date found which matches a specific component value.
 | 
			
		||||
	The general semantics follow those of the -enumerateDatesStartingAfterDate:... method above.
 | 
			
		||||
	To compute a sequence of results, use the -enumerateDatesStartingAfterDate:... method above, rather than looping and calling this method with the previous loop iteration's result.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSDate *)nextDateAfterDate:(NSDate *)date matchingUnit:(NSCalendarUnit)unit value:(NSInteger)value options:(NSCalendarOptions)options API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API returns a new NSDate object representing the date found which matches the given hour, minute, and second values.
 | 
			
		||||
	The general semantics follow those of the -enumerateDatesStartingAfterDate:... method above.
 | 
			
		||||
	To compute a sequence of results, use the -enumerateDatesStartingAfterDate:... method above, rather than looping and calling this method with the previous loop iteration's result.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSDate *)nextDateAfterDate:(NSDate *)date matchingHour:(NSInteger)hourValue minute:(NSInteger)minuteValue second:(NSInteger)secondValue options:(NSCalendarOptions)options API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API returns a new NSDate object representing the date calculated by setting a specific component to a given time, and trying to keep lower components the same.  If the unit already has that value, this may result in a date which is the same as the given date.
 | 
			
		||||
	Changing a component's value often will require higher or coupled components to change as well.  For example, setting the Weekday to Thursday usually will require the Day component to change its value, and possibly the Month and Year as well.
 | 
			
		||||
	If no such time exists, the next available time is returned (which could, for example, be in a different day, week, month, ... than the nominal target date).  Setting a component to something which would be inconsistent forces other units to change; for example, setting the Weekday to Thursday probably shifts the Day and possibly Month and Year.
 | 
			
		||||
	The specific behaviors here are as yet unspecified; for example, if I change the weekday to Thursday, does that move forward to the next, backward to the previous, or to the nearest Thursday?  A likely rule is that the algorithm will try to produce a result which is in the next-larger unit to the one given (there's a table of this mapping at the top of this document).  So for the "set to Thursday" example, find the Thursday in the Week in which the given date resides (which could be a forwards or backwards move, and not necessarily the nearest Thursday).  For forwards or backwards behavior, one can use the -nextDateAfterDate:matchingUnit:value:options: method above.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSDate *)dateBySettingUnit:(NSCalendarUnit)unit value:(NSInteger)v ofDate:(NSDate *)date options:(NSCalendarOptions)opts API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API returns a new NSDate object representing the date calculated by setting hour, minute, and second to a given time.
 | 
			
		||||
	If no such time exists, the next available time is returned (which could, for example, be in a different day than the nominal target date).
 | 
			
		||||
	The intent is to return a date on the same day as the original date argument.  This may result in a date which is earlier than the given date, of course.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSDate *)dateBySettingHour:(NSInteger)h minute:(NSInteger)m second:(NSInteger)s ofDate:(NSDate *)date options:(NSCalendarOptions)opts API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    This API returns YES if the date has all the matched components. Otherwise, it returns NO.
 | 
			
		||||
    It is useful to test the return value of the -nextDateAfterDate:matchingUnit:value:options:, to find out if the components were obeyed or if the method had to fudge the result value due to missing time.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)date:(NSDate *)date matchesComponents:(NSDateComponents *)components API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This notification is posted through [NSNotificationCenter defaultCenter]
 | 
			
		||||
// when the system day changes. Register with "nil" as the object of this
 | 
			
		||||
// notification. If the computer/device is asleep when the day changed,
 | 
			
		||||
// this will be posted on wakeup. You'll get just one of these if the
 | 
			
		||||
// machine has been asleep for several days. The definition of "Day" is
 | 
			
		||||
// relative to the current calendar (NSCalendar.currentCalendar) of the
 | 
			
		||||
// process and its locale and time zone. There are no guarantees that this
 | 
			
		||||
// notification is received by observers in a "timely" manner, same as
 | 
			
		||||
// with distributed notifications.
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSCalendarDayChangedNotification API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This is a just used as an extensible struct, basically;
 | 
			
		||||
// note that there are two uses: one for specifying a date
 | 
			
		||||
// via components (some components may be missing, making the
 | 
			
		||||
// specific date ambiguous), and the other for specifying a
 | 
			
		||||
// set of component quantities (like, 3 months and 5 hours).
 | 
			
		||||
// Undefined fields have (or fields can be set to) the value
 | 
			
		||||
// NSDateComponentUndefined.
 | 
			
		||||
 | 
			
		||||
// NSDateComponents is not responsible for answering questions
 | 
			
		||||
// about a date beyond the information it has been initialized
 | 
			
		||||
// with; for example, if you initialize one with May 6, 2004,
 | 
			
		||||
// and then ask for the weekday, you'll get Undefined, not Thurs.
 | 
			
		||||
// A NSDateComponents is meaningless in itself, because you need
 | 
			
		||||
// to know what calendar it is interpreted against, and you need
 | 
			
		||||
// to know whether the values are absolute values of the units,
 | 
			
		||||
// or quantities of the units.
 | 
			
		||||
// When you create a new one of these, all values begin Undefined.
 | 
			
		||||
 | 
			
		||||
NS_ENUM(NSInteger) {
 | 
			
		||||
	NSDateComponentUndefined = NSIntegerMax,
 | 
			
		||||
 | 
			
		||||
	NSUndefinedDateComponent API_DEPRECATED_WITH_REPLACEMENT("NSDateComponentUndefined", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0)) = NSDateComponentUndefined
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSDateComponents : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSCalendar *calendar API_AVAILABLE(macos(10.7), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (nullable, copy) NSTimeZone *timeZone API_AVAILABLE(macos(10.7), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property NSInteger era;
 | 
			
		||||
@property NSInteger year;
 | 
			
		||||
@property NSInteger month;
 | 
			
		||||
@property NSInteger day;
 | 
			
		||||
@property NSInteger hour;
 | 
			
		||||
@property NSInteger minute;
 | 
			
		||||
@property NSInteger second;
 | 
			
		||||
@property NSInteger nanosecond API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property NSInteger weekday;
 | 
			
		||||
@property NSInteger weekdayOrdinal;
 | 
			
		||||
@property NSInteger quarter API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property NSInteger weekOfMonth API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property NSInteger weekOfYear API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property NSInteger yearForWeekOfYear API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (getter=isLeapMonth) BOOL leapMonth API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (nullable, readonly, copy) NSDate *date API_AVAILABLE(macos(10.7), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (NSInteger)week API_DEPRECATED("Use -weekOfMonth or -weekOfYear, depending on which you mean", macos(10.4, 10.9), ios(2.0, 7.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (void)setWeek:(NSInteger)v API_DEPRECATED("Use -setWeekOfMonth: or -setWeekOfYear:, depending on which you mean", macos(10.4, 10.9), ios(2.0, 7.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API allows one to set a specific component of NSDateComponents, by enum constant value rather than property name.
 | 
			
		||||
	The calendar and timeZone and isLeapMonth properties cannot be set by this method.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setValue:(NSInteger)value forComponent:(NSCalendarUnit)unit API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	This API allows one to get the value of a specific component of NSDateComponents, by enum constant value rather than property name.
 | 
			
		||||
	The calendar and timeZone and isLeapMonth property values cannot be gotten by this method.
 | 
			
		||||
*/
 | 
			
		||||
- (NSInteger)valueForComponent:(NSCalendarUnit)unit API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	Reports whether or not the combination of properties which have been set in the receiver is a date which exists in the calendar.
 | 
			
		||||
	This method is not appropriate for use on NSDateComponents objects which are specifying relative quantities of calendar components.
 | 
			
		||||
	Except for some trivial cases (e.g., 'seconds' should be 0 - 59 in any calendar), this method is not necessarily cheap.
 | 
			
		||||
	If the time zone property is set in the NSDateComponents object, it is used.
 | 
			
		||||
	The calendar property must be set, or NO is returned.
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isValidDate, readonly) BOOL validDate API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	Reports whether or not the combination of properties which have been set in the receiver is a date which exists in the calendar.
 | 
			
		||||
	This method is not appropriate for use on NSDateComponents objects which are specifying relative quantities of calendar components.
 | 
			
		||||
	Except for some trivial cases (e.g., 'seconds' should be 0 - 59 in any calendar), this method is not necessarily cheap.
 | 
			
		||||
	If the time zone property is set in the NSDateComponents object, it is used.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)isValidDateInCalendar:(NSCalendar *)calendar API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,83 @@
 | 
			
		||||
/*	NSCalendarDate.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSArray, NSTimeZone;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
#if !defined(NS_CALENDAR_ENUM_DEPRECATED)
 | 
			
		||||
#if 1 || NS_ENABLE_CALENDAR_DEPRECATIONS
 | 
			
		||||
#define NS_CALENDAR_ENUM_DEPRECATED(A, B, C, D, ...) NS_ENUM_DEPRECATED(A, B, C, D, __VA_ARGS__)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED(A, B, C, D, ...) NS_DEPRECATED(A, B, C, D, __VA_ARGS__)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED_MAC(A, B, ...) NS_DEPRECATED_MAC(A, B, __VA_ARGS__)
 | 
			
		||||
#else
 | 
			
		||||
#define NS_CALENDAR_ENUM_DEPRECATED(A, B, C, D, ...) NS_ENUM_AVAILABLE(A, C)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED(A, B, C, D, ...) NS_AVAILABLE(A, C)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED_MAC(A, B, ...) NS_AVAILABLE_MAC(A)
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use NSCalendar and NSDateComponents and NSDateFormatter instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0))
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("Use NSCalendar and NSDateComponents and NSDateFormatter instead")
 | 
			
		||||
@interface NSCalendarDate : NSDate {
 | 
			
		||||
@private
 | 
			
		||||
    NSUInteger		refCount;
 | 
			
		||||
    NSTimeInterval 	_timeIntervalSinceReferenceDate;
 | 
			
		||||
    NSTimeZone		*_timeZone;
 | 
			
		||||
    NSString 		*_formatString;
 | 
			
		||||
    void		*_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*    DEPRECATED DEPRECATED DEPRECATED
 | 
			
		||||
 *    These methods are deprecated.
 | 
			
		||||
 *    Use NSCalendar for calendrical calculations.
 | 
			
		||||
 *    Use NSDateFormatter for date<->string conversions.
 | 
			
		||||
 */
 | 
			
		||||
+ (id)calendarDate API_DEPRECATED("Use NSCalendar instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
+ (nullable id)dateWithString:(NSString *)description calendarFormat:(NSString *)format locale:(nullable id)locale API_DEPRECATED("Use NSDateFormatter instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
+ (nullable id)dateWithString:(NSString *)description calendarFormat:(NSString *)format API_DEPRECATED("Use NSDateFormatter instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
+ (id)dateWithYear:(NSInteger)year month:(NSUInteger)month day:(NSUInteger)day hour:(NSUInteger)hour minute:(NSUInteger)minute second:(NSUInteger)second timeZone:(nullable NSTimeZone *)aTimeZone API_DEPRECATED("Use NSCalendar and NSDateComponents instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSCalendarDate *)dateByAddingYears:(NSInteger)year months:(NSInteger)month days:(NSInteger)day hours:(NSInteger)hour minutes:(NSInteger)minute seconds:(NSInteger)second API_DEPRECATED("Use NSCalendar instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSInteger)dayOfCommonEra API_DEPRECATED_WITH_REPLACEMENT("-[NSCalendar component:fromDate:]", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSInteger)dayOfMonth API_DEPRECATED_WITH_REPLACEMENT("-[NSCalendar component:fromDate:]", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSInteger)dayOfWeek API_DEPRECATED_WITH_REPLACEMENT("-[NSCalendar component:fromDate:]", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSInteger)dayOfYear API_DEPRECATED_WITH_REPLACEMENT("-[NSCalendar component:fromDate:]", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSInteger)hourOfDay API_DEPRECATED_WITH_REPLACEMENT("-[NSCalendar component:fromDate:]", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSInteger)minuteOfHour API_DEPRECATED_WITH_REPLACEMENT("-[NSCalendar component:fromDate:]", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSInteger)monthOfYear API_DEPRECATED_WITH_REPLACEMENT("-[NSCalendar component:fromDate:]", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSInteger)secondOfMinute API_DEPRECATED_WITH_REPLACEMENT("-[NSCalendar component:fromDate:]", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSInteger)yearOfCommonEra API_DEPRECATED_WITH_REPLACEMENT("-[NSCalendar component:fromDate:]", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSString *)calendarFormat API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSString *)descriptionWithCalendarFormat:(NSString *)format locale:(nullable id)locale API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSString *)descriptionWithCalendarFormat:(NSString *)format API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSString *)descriptionWithLocale:(nullable id)locale API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSTimeZone *)timeZone API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (nullable id)initWithString:(NSString *)description calendarFormat:(NSString *)format locale:(nullable id)locale API_DEPRECATED("Use NSDateFormatter instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (nullable id)initWithString:(NSString *)description calendarFormat:(NSString *)format API_DEPRECATED("Use NSDateFormatter instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (nullable id)initWithString:(NSString *)description API_DEPRECATED("Use NSDateFormatter instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (id)initWithYear:(NSInteger)year month:(NSUInteger)month day:(NSUInteger)day hour:(NSUInteger)hour minute:(NSUInteger)minute second:(NSUInteger)second timeZone:(nullable NSTimeZone *)aTimeZone API_DEPRECATED("Use NSCalendar and NSDateComponents instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (void)setCalendarFormat:(nullable NSString *)format API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (void)setTimeZone:(nullable NSTimeZone *)aTimeZone API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (void)years:(nullable NSInteger *)yp months:(nullable NSInteger *)mop days:(nullable NSInteger *)dp hours:(nullable NSInteger *)hp minutes:(nullable NSInteger *)mip seconds:(nullable NSInteger *)sp sinceDate:(NSCalendarDate *)date API_DEPRECATED_WITH_REPLACEMENT("-[NSCalendar components:fromDate:]", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
+ (instancetype)distantFuture API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
+ (instancetype)distantPast API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDate (NSCalendarDateExtras)
 | 
			
		||||
/*    DEPRECATED DEPRECATED DEPRECATED
 | 
			
		||||
 *    These methods are deprecated.
 | 
			
		||||
 *    Use NSCalendar for calendrical calculations.
 | 
			
		||||
 *    Use NSDateFormatter for date<->string conversions.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable id)dateWithNaturalLanguageString:(NSString *)string locale:(nullable id)locale API_DEPRECATED("Create an NSDateFormatter with `init` and set the dateFormat property instead.", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
+ (nullable id)dateWithNaturalLanguageString:(NSString *)string API_DEPRECATED("Create an NSDateFormatter with `init` and set the dateFormat property instead.", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
+ (id)dateWithString:(NSString *)aString API_DEPRECATED("Use NSDateFormatter instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (NSCalendarDate *)dateWithCalendarFormat:(nullable NSString *)format timeZone:(nullable NSTimeZone *)aTimeZone API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (nullable NSString *)descriptionWithCalendarFormat:(nullable NSString *)format timeZone:(nullable NSTimeZone *)aTimeZone locale:(nullable id)locale API_DEPRECATED("", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
- (nullable id)initWithString:(NSString *)description API_DEPRECATED("Use NSDateFormatter instead", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,87 @@
 | 
			
		||||
/*	NSCharacterSet.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <CoreFoundation/CFCharacterSet.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSRange.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
 | 
			
		||||
@class NSData;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
    NSOpenStepUnicodeReservedBase = 0xF400
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@interface NSCharacterSet : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *controlCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *whitespaceCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *whitespaceAndNewlineCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *decimalDigitCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *letterCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *lowercaseLetterCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *uppercaseLetterCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *nonBaseCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *alphanumericCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *decomposableCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *illegalCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *punctuationCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *capitalizedLetterCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *symbolCharacterSet;
 | 
			
		||||
@property (readonly, class, copy) NSCharacterSet *newlineCharacterSet API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
+ (NSCharacterSet *)characterSetWithRange:(NSRange)aRange;
 | 
			
		||||
+ (NSCharacterSet *)characterSetWithCharactersInString:(NSString *)aString;
 | 
			
		||||
+ (NSCharacterSet *)characterSetWithBitmapRepresentation:(NSData *)data;
 | 
			
		||||
+ (nullable NSCharacterSet *)characterSetWithContentsOfFile:(NSString *)fName;
 | 
			
		||||
 | 
			
		||||
- (instancetype) initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (BOOL)characterIsMember:(unichar)aCharacter;
 | 
			
		||||
@property (readonly, copy) NSData *bitmapRepresentation;
 | 
			
		||||
@property (readonly, copy) NSCharacterSet *invertedSet;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (BOOL)longCharacterIsMember:(UTF32Char)theLongChar;
 | 
			
		||||
 | 
			
		||||
- (BOOL)isSupersetOfSet:(NSCharacterSet *)theOtherSet;
 | 
			
		||||
- (BOOL)hasMemberInPlane:(uint8_t)thePlane;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableCharacterSet : NSCharacterSet <NSCopying, NSMutableCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
- (void)addCharactersInRange:(NSRange)aRange;
 | 
			
		||||
- (void)removeCharactersInRange:(NSRange)aRange;
 | 
			
		||||
- (void)addCharactersInString:(NSString *)aString;
 | 
			
		||||
- (void)removeCharactersInString:(NSString *)aString;
 | 
			
		||||
- (void)formUnionWithCharacterSet:(NSCharacterSet *)otherSet;
 | 
			
		||||
- (void)formIntersectionWithCharacterSet:(NSCharacterSet *)otherSet;
 | 
			
		||||
- (void)invert;
 | 
			
		||||
 | 
			
		||||
+ (NSMutableCharacterSet *)controlCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)whitespaceCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)whitespaceAndNewlineCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)decimalDigitCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)letterCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)lowercaseLetterCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)uppercaseLetterCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)nonBaseCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)alphanumericCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)decomposableCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)illegalCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)punctuationCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)capitalizedLetterCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)symbolCharacterSet;
 | 
			
		||||
+ (NSMutableCharacterSet *)newlineCharacterSet API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
+ (NSMutableCharacterSet *)characterSetWithRange:(NSRange)aRange;
 | 
			
		||||
+ (NSMutableCharacterSet *)characterSetWithCharactersInString:(NSString *)aString;
 | 
			
		||||
+ (NSMutableCharacterSet *)characterSetWithBitmapRepresentation:(NSData *)data;
 | 
			
		||||
+ (nullable NSMutableCharacterSet *)characterSetWithContentsOfFile:(NSString *)fName;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,38 @@
 | 
			
		||||
/*	NSClassDescription.h
 | 
			
		||||
	Copyright (c) 1995-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSException.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSArray<ObjectType>, NSDictionary;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSClassDescription : NSObject
 | 
			
		||||
 | 
			
		||||
+ (void)registerClassDescription:(NSClassDescription *)description forClass:(Class)aClass;
 | 
			
		||||
+ (void)invalidateClassDescriptionCache;
 | 
			
		||||
+ (nullable NSClassDescription *)classDescriptionForClass:(Class)aClass;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *attributeKeys;
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *toOneRelationshipKeys;
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *toManyRelationshipKeys;
 | 
			
		||||
- (nullable NSString *)inverseForRelationshipKey:(NSString *)relationshipKey;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSObject (NSClassDescriptionPrimitives)
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSClassDescription *classDescription;
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *attributeKeys;
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *toOneRelationshipKeys;
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *toManyRelationshipKeys;
 | 
			
		||||
- (nullable NSString *)inverseForRelationshipKey:(NSString *)relationshipKey;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName NSClassDescriptionNeededForClassNotification;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,227 @@
 | 
			
		||||
/*	NSCoder.h
 | 
			
		||||
	Copyright (c) 1993-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSData, NSSet<ObjectType>;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 Describes the action an NSCoder should take when it encounters decode failures (e.g. corrupt data) for non-TopLevel decodes.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSDecodingFailurePolicy) {
 | 
			
		||||
    // On decode failure, the NSCoder will raise an exception internally to propagate failure messages (and unwind the stack). This exception can be transformed into an NSError via any of the TopLevel decode APIs.
 | 
			
		||||
    NSDecodingFailurePolicyRaiseException,
 | 
			
		||||
 | 
			
		||||
    // On decode failure, the NSCoder will capture the failure as an NSError, and prevent further decodes (by returning 0 / nil equivalent as appropriate). Clients should consider using this policy if they know that all encoded objects behave correctly in the presence of decode failures (e.g. they use -failWithError: to communicate decode failures and don't raise exceptions for error propagation)
 | 
			
		||||
    NSDecodingFailurePolicySetErrorAndReturn,
 | 
			
		||||
} API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@interface NSCoder : NSObject
 | 
			
		||||
 | 
			
		||||
- (void)encodeValueOfObjCType:(const char *)type at:(const void *)addr;
 | 
			
		||||
- (void)encodeDataObject:(NSData *)data;
 | 
			
		||||
- (nullable NSData *)decodeDataObject;
 | 
			
		||||
- (void)decodeValueOfObjCType:(const char *)type at:(void *)data size:(NSUInteger)size API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
- (NSInteger)versionForClassName:(NSString *)className;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCoder (NSExtendedCoder)
 | 
			
		||||
    
 | 
			
		||||
- (void)encodeObject:(nullable id)object;
 | 
			
		||||
- (void)encodeRootObject:(id)rootObject;
 | 
			
		||||
- (void)encodeBycopyObject:(nullable id)anObject;
 | 
			
		||||
- (void)encodeByrefObject:(nullable id)anObject;
 | 
			
		||||
- (void)encodeConditionalObject:(nullable id)object;
 | 
			
		||||
- (void)encodeValuesOfObjCTypes:(const char *)types, ...;
 | 
			
		||||
- (void)encodeArrayOfObjCType:(const char *)type count:(NSUInteger)count at:(const void *)array;
 | 
			
		||||
- (void)encodeBytes:(nullable const void *)byteaddr length:(NSUInteger)length;
 | 
			
		||||
 | 
			
		||||
- (nullable id)decodeObject;
 | 
			
		||||
- (nullable id)decodeTopLevelObjectAndReturnError:(NSError **)error API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) NS_SWIFT_UNAVAILABLE("Use 'decodeTopLevelObject() throws' instead");
 | 
			
		||||
- (void)decodeValuesOfObjCTypes:(const char *)types, ...;
 | 
			
		||||
- (void)decodeArrayOfObjCType:(const char *)itemType count:(NSUInteger)count at:(void *)array;
 | 
			
		||||
- (nullable void *)decodeBytesWithReturnedLength:(NSUInteger *)lengthp NS_RETURNS_INNER_POINTER;
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
- (void)encodePropertyList:(id)aPropertyList;
 | 
			
		||||
- (nullable id)decodePropertyList;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
- (void)setObjectZone:(nullable NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
 | 
			
		||||
- (nullable NSZone *)objectZone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property (readonly) unsigned int systemVersion;
 | 
			
		||||
 | 
			
		||||
@property (readonly) BOOL allowsKeyedCoding;
 | 
			
		||||
 | 
			
		||||
- (void)encodeObject:(nullable id)object forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeConditionalObject:(nullable id)object forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeBool:(BOOL)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeInt:(int)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeInt32:(int32_t)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeInt64:(int64_t)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeFloat:(float)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeDouble:(double)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeBytes:(nullable const uint8_t *)bytes length:(NSUInteger)length forKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
- (BOOL)containsValueForKey:(NSString *)key;
 | 
			
		||||
- (nullable id)decodeObjectForKey:(NSString *)key;
 | 
			
		||||
- (nullable id)decodeTopLevelObjectForKey:(NSString *)key error:(NSError **)error API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) NS_SWIFT_UNAVAILABLE("Use 'decodeObject(of:, forKey:)' instead");
 | 
			
		||||
- (BOOL)decodeBoolForKey:(NSString *)key;
 | 
			
		||||
- (int)decodeIntForKey:(NSString *)key;
 | 
			
		||||
- (int32_t)decodeInt32ForKey:(NSString *)key;
 | 
			
		||||
- (int64_t)decodeInt64ForKey:(NSString *)key;
 | 
			
		||||
- (float)decodeFloatForKey:(NSString *)key;
 | 
			
		||||
- (double)decodeDoubleForKey:(NSString *)key;
 | 
			
		||||
- (nullable const uint8_t *)decodeBytesForKey:(NSString *)key returnedLength:(nullable NSUInteger *)lengthp NS_RETURNS_INNER_POINTER;   // returned bytes immutable!
 | 
			
		||||
 | 
			
		||||
- (void)encodeInteger:(NSInteger)value forKey:(NSString *)key API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSInteger)decodeIntegerForKey:(NSString *)key API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Returns YES if this coder requires secure coding. Secure coders check a list of allowed classes before decoding objects, and all objects must implement NSSecureCoding.
 | 
			
		||||
@property (readonly) BOOL requiresSecureCoding API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Specify what the expected class of the allocated object is. If the coder responds YES to -requiresSecureCoding, then an exception will be thrown if the class to be decoded does not implement NSSecureCoding or is not isKindOfClass: of the argument. If the coder responds NO to -requiresSecureCoding, then the class argument is ignored and no check of the class of the decoded object is performed, exactly as if decodeObjectForKey: had been called.
 | 
			
		||||
- (nullable id)decodeObjectOfClass:(Class)aClass forKey:(NSString *)key API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (nullable id)decodeTopLevelObjectOfClass:(Class)aClass forKey:(NSString *)key error:(NSError **)error API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) NS_SWIFT_UNAVAILABLE("Use 'decodeObject(of:, forKey:)' instead");
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 Decodes the \c NSArray object for the given  \c key, which should be an \c NSArray<cls>, containing the given non-collection class (no nested arrays or arrays of dictionaries, etc) from the coder.
 | 
			
		||||
 | 
			
		||||
 Requires \c NSSecureCoding otherwise an exception is thrown and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
 Returns \c nil if the object for \c key is not of the expected types, or cannot be decoded, and sets the \c error on the decoder.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSArray *)decodeArrayOfObjectsOfClass:(Class)cls forKey:(NSString *)key API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Decodes the \c NSDictionary object for the given \c key, which should be an \c NSDictionary<keyCls,objectCls> , with keys of type given in \c keyCls and objects of the given non-collection class \c objectCls (no nested dictionaries or other dictionaries contained in the dictionary, etc) from the coder.
 | 
			
		||||
 | 
			
		||||
 Requires \c NSSecureCoding otherwise an exception is thrown and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
 Returns \c nil if the object for \c key is not of the expected types, or cannot be decoded, and sets the \c error on the decoder.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSDictionary *)decodeDictionaryWithKeysOfClass:(Class)keyCls objectsOfClass:(Class)objectCls forKey:(NSString *)key API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
// The class of the object may be any class in the provided NSSet, or a subclass of any class in the set. Otherwise, the behavior is the same as -decodeObjectOfClass:forKey:.
 | 
			
		||||
- (nullable id)decodeObjectOfClasses:(nullable NSSet<Class> *)classes forKey:(NSString *)key API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
- (nullable id)decodeTopLevelObjectOfClasses:(nullable NSSet<Class> *)classes forKey:(NSString *)key error:(NSError **)error API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) NS_SWIFT_UNAVAILABLE("Use 'decodeObject(of:, forKey:)' instead");
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 Decodes the \c NSArray object for the given \c key, which should be an \c NSArray, containing the given non-collection classes (no nested arrays or arrays of dictionaries, etc) from the coder.
 | 
			
		||||
 | 
			
		||||
 Requires \c NSSecureCoding otherwise an exception is thrown and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
 Returns \c nil if the object for \c key is not of the expected types, or cannot be decoded, and sets the \c error on the decoder.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSArray *)decodeArrayOfObjectsOfClasses:(NSSet<Class> *)classes forKey:(NSString *)key API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 Decodes the \c NSDictionary object for the given \c key, which should be an \c NSDictionary, with keys of the types given in \c keyClasses and objects of the given non-collection classes in \c objectClasses (no nested dictionaries or other dictionaries contained in the dictionary, etc) from the given coder.
 | 
			
		||||
 | 
			
		||||
 Requires \c NSSecureCoding otherwise an exception is thrown and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
 Returns \c nil if the object for \c key is not of the expected types, or cannot be decoded, and sets the \c error on the decoder.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSDictionary *)decodeDictionaryWithKeysOfClasses:(NSSet<Class> *)keyClasses objectsOfClasses:(NSSet<Class> *)objectClasses forKey:(NSString *)key API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
// Calls -decodeObjectOfClasses:forKey: with a set allowing only property list types.
 | 
			
		||||
- (nullable id)decodePropertyListForKey:(NSString *)key API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Get the current set of allowed classes.
 | 
			
		||||
@property (nullable, readonly, copy) NSSet<Class> *allowedClasses API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 @abstract Signals to this coder that the decode has failed.
 | 
			
		||||
 @parameter non-nil error that describes the reason why the decode failed
 | 
			
		||||
 @discussion
 | 
			
		||||
 Sets an error on this NSCoder once per TopLevel decode; calling it repeatedly will have no effect until the call stack unwinds to one of the TopLevel decode entry-points.
 | 
			
		||||
 | 
			
		||||
 This method is only meaningful to call for decodes.
 | 
			
		||||
 | 
			
		||||
 Typically, you would want to call this method in your -initWithCoder: implementation when you detect situations like:
 | 
			
		||||
 - lack of secure coding
 | 
			
		||||
 - corruption of your data
 | 
			
		||||
 - domain validation failures
 | 
			
		||||
 | 
			
		||||
 After calling -failWithError: within your -initWithCoder: implementation, you should clean up and return nil as early as possible.
 | 
			
		||||
 | 
			
		||||
 Once an error has been signaled to a decoder, it remains set until it has handed off to the first TopLevel decode invocation above it.  For example, consider the following call graph:
 | 
			
		||||
 A    -decodeTopLevelObjectForKey:error:
 | 
			
		||||
 B        -initWithCoder:
 | 
			
		||||
 C            -decodeObjectForKey:
 | 
			
		||||
 D                -initWithCoder:
 | 
			
		||||
 E                    -decodeObjectForKey:
 | 
			
		||||
 F                        -failWithError:
 | 
			
		||||
 | 
			
		||||
 In this case the error provided in stack-frame F will be returned via the outError in stack-frame A. Furthermore the result object from decodeTopLevelObjectForKey:error: will be nil, regardless of the result of stack-frame B.
 | 
			
		||||
 | 
			
		||||
 NSCoder implementations support two mechanisms for the stack-unwinding from F to A:
 | 
			
		||||
 - forced (NSException based)
 | 
			
		||||
 - particpatory (error based)
 | 
			
		||||
 | 
			
		||||
 The kind of unwinding you get is determined by the decodingFailurePolicy property of this NSCoder (which defaults to NSDecodingFailurePolicyRaiseException to match historical behavior).
 | 
			
		||||
 */
 | 
			
		||||
- (void)failWithError:(NSError *)error API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 @abstract Defines the behavior this NSCoder should take on decode failure (i.e. corrupt archive, invalid data, etc.).
 | 
			
		||||
 @discussion
 | 
			
		||||
 The default result of this property is NSDecodingFailurePolicyRaiseException, subclasses can change this to an alternative policy.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) NSDecodingFailurePolicy decodingFailurePolicy API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 @abstract The current error (if there is one) for the current TopLevel decode.
 | 
			
		||||
 @discussion
 | 
			
		||||
 The meaning of this property changes based on the result of the decodingFailurePolicy property:
 | 
			
		||||
 For NSDecodingFailurePolicyRaiseException, this property will always be nil.
 | 
			
		||||
 For NSDecodingFailurePolicySetErrorAndReturn, this property can be non-nil, and if so, indicates that there was a failure while decoding the archive (specifically its the very first error encountered).
 | 
			
		||||
 | 
			
		||||
 While .error is non-nil, all attempts to decode data from this coder will return a nil/zero-equivalent value.
 | 
			
		||||
 | 
			
		||||
 This error is consumed by a TopLevel decode API (which resets this coder back to a being able to potentially decode data).
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, readonly, copy) NSError *error API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
FOUNDATION_EXPORT NSObject * _Nullable NXReadNSObjectFromCoder(NSCoder *decoder) API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
/* Given an NSCoder, returns an object previously written with
 | 
			
		||||
   NXWriteNSObject(). The returned object is autoreleased. */
 | 
			
		||||
 | 
			
		||||
@interface NSCoder (NSTypedstreamCompatibility)
 | 
			
		||||
 | 
			
		||||
- (void)encodeNXObject:(id)object API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
/* Writes old-style object onto the coder. No sharing is done across
 | 
			
		||||
   separate -encodeNXObject:. Callers must have implemented an
 | 
			
		||||
   -encodeWithCoder:, which parallels the -write: methods, on all of
 | 
			
		||||
   their classes which may be touched by this operation. Object's
 | 
			
		||||
   -replacementObjectForCoder: compatibility method will take care
 | 
			
		||||
   of calling -startArchiving:. */
 | 
			
		||||
    
 | 
			
		||||
- (nullable id)decodeNXObject API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
/* Reads an object previously written with -encodeNXObject:. No
 | 
			
		||||
   sharing is done across separate -decodeNXObject. Callers must
 | 
			
		||||
   have implemented an -initWithCoder:, which parallels the -read:
 | 
			
		||||
   methods, on all of their classes which may be touched by this
 | 
			
		||||
   operation. Object's -awakeAfterUsingCoder: compatibility method
 | 
			
		||||
   will take care of calling -awake and -finishUnarchiving. The
 | 
			
		||||
   returned object is autoreleased. */
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@interface NSCoder(NSDeprecated)
 | 
			
		||||
/* This method is unsafe because it could potentially cause buffer overruns. You should use -decodeValueOfObjCType:at:size: instead.
 | 
			
		||||
 */
 | 
			
		||||
- (void)decodeValueOfObjCType:(const char *)type at:(void *)data API_DEPRECATED_WITH_REPLACEMENT("decodeValueOfObjCType:at:size:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,72 @@
 | 
			
		||||
/*	NSComparisonPredicate.h
 | 
			
		||||
	Copyright (c) 2004-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSPredicate.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
// Flags(s) that can be passed to the factory to indicate that a operator operating on strings should do so in a case insensitive fashion.
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSComparisonPredicateOptions) {
 | 
			
		||||
    NSCaseInsensitivePredicateOption = 0x01,
 | 
			
		||||
    NSDiacriticInsensitivePredicateOption = 0x02,
 | 
			
		||||
    NSNormalizedPredicateOption API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 0x04, /* Indicate that the strings to be compared have been preprocessed; this supersedes other options and is intended as a performance optimization option */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Describes how the operator is modified: can be direct, ALL, or ANY
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSComparisonPredicateModifier) {
 | 
			
		||||
    NSDirectPredicateModifier = 0, // Do a direct comparison
 | 
			
		||||
    NSAllPredicateModifier, // ALL toMany.x = y
 | 
			
		||||
    NSAnyPredicateModifier // ANY toMany.x = y
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Type basic set of operators defined. Most are obvious; NSCustomSelectorPredicateOperatorType allows a developer to create an operator which uses the custom selector specified in the constructor to do the evaluation.
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSPredicateOperatorType) {
 | 
			
		||||
    NSLessThanPredicateOperatorType = 0, // compare: returns NSOrderedAscending
 | 
			
		||||
    NSLessThanOrEqualToPredicateOperatorType, // compare: returns NSOrderedAscending || NSOrderedSame
 | 
			
		||||
    NSGreaterThanPredicateOperatorType, // compare: returns NSOrderedDescending
 | 
			
		||||
    NSGreaterThanOrEqualToPredicateOperatorType, // compare: returns NSOrderedDescending || NSOrderedSame
 | 
			
		||||
    NSEqualToPredicateOperatorType, // isEqual: returns true
 | 
			
		||||
    NSNotEqualToPredicateOperatorType, // isEqual: returns false
 | 
			
		||||
    NSMatchesPredicateOperatorType,
 | 
			
		||||
    NSLikePredicateOperatorType,
 | 
			
		||||
    NSBeginsWithPredicateOperatorType,
 | 
			
		||||
    NSEndsWithPredicateOperatorType,
 | 
			
		||||
    NSInPredicateOperatorType, // rhs contains lhs returns true
 | 
			
		||||
    NSCustomSelectorPredicateOperatorType,
 | 
			
		||||
    NSContainsPredicateOperatorType API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)) = 99, // lhs contains rhs returns true
 | 
			
		||||
    NSBetweenPredicateOperatorType API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@class NSPredicateOperator;
 | 
			
		||||
@class NSExpression;
 | 
			
		||||
 | 
			
		||||
// Comparison predicates are predicates which do some form of comparison between the results of two expressions and return a BOOL. They take an operator, a left expression, and a right expression, and return the result of invoking the operator with the results of evaluating the expressions.
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.4), ios(3.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSComparisonPredicate : NSPredicate {
 | 
			
		||||
    @private
 | 
			
		||||
    void *_reserved2;
 | 
			
		||||
    NSPredicateOperator *_predicateOperator;
 | 
			
		||||
    NSExpression *_lhs;
 | 
			
		||||
    NSExpression *_rhs;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
+ (NSComparisonPredicate *)predicateWithLeftExpression:(NSExpression *)lhs rightExpression:(NSExpression *)rhs modifier:(NSComparisonPredicateModifier)modifier type:(NSPredicateOperatorType)type options:(NSComparisonPredicateOptions)options;
 | 
			
		||||
+ (NSComparisonPredicate *)predicateWithLeftExpression:(NSExpression *)lhs rightExpression:(NSExpression *)rhs customSelector:(SEL)selector;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithLeftExpression:(NSExpression *)lhs rightExpression:(NSExpression *)rhs modifier:(NSComparisonPredicateModifier)modifier type:(NSPredicateOperatorType)type options:(NSComparisonPredicateOptions)options NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithLeftExpression:(NSExpression *)lhs rightExpression:(NSExpression *)rhs customSelector:(SEL)selector NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSPredicateOperatorType predicateOperatorType;
 | 
			
		||||
@property (readonly) NSComparisonPredicateModifier comparisonPredicateModifier;
 | 
			
		||||
@property (readonly, retain) NSExpression *leftExpression;
 | 
			
		||||
@property (readonly, retain) NSExpression *rightExpression;
 | 
			
		||||
@property (nullable, readonly) SEL customSelector;
 | 
			
		||||
@property (readonly) NSComparisonPredicateOptions options;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,40 @@
 | 
			
		||||
/*	NSCompoundPredicate.h
 | 
			
		||||
	Copyright (c) 2004-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSPredicate.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
// Compound predicates are predicates which act on the results of evaluating other operators. We provide the basic boolean operators: AND, OR, and NOT.
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSCompoundPredicateType) {
 | 
			
		||||
    NSNotPredicateType = 0, 
 | 
			
		||||
    NSAndPredicateType,
 | 
			
		||||
    NSOrPredicateType,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.4), ios(3.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSCompoundPredicate : NSPredicate {
 | 
			
		||||
    @private
 | 
			
		||||
    void *_reserved2;
 | 
			
		||||
    NSUInteger _type;
 | 
			
		||||
    NSArray *_subpredicates;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithType:(NSCompoundPredicateType)type subpredicates:(NSArray<NSPredicate *> *)subpredicates NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSCompoundPredicateType compoundPredicateType;
 | 
			
		||||
@property (readonly, copy) NSArray *subpredicates;
 | 
			
		||||
 | 
			
		||||
/*** Convenience Methods ***/
 | 
			
		||||
+ (NSCompoundPredicate *)andPredicateWithSubpredicates:(NSArray<NSPredicate *> *)subpredicates NS_SWIFT_NAME(init(andPredicateWithSubpredicates:));
 | 
			
		||||
+ (NSCompoundPredicate *)orPredicateWithSubpredicates:(NSArray<NSPredicate *> *)subpredicates NS_SWIFT_NAME(init(orPredicateWithSubpredicates:));
 | 
			
		||||
+ (NSCompoundPredicate *)notPredicateWithSubpredicate:(NSPredicate *)predicate NS_SWIFT_NAME(init(notPredicateWithSubpredicate:));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,150 @@
 | 
			
		||||
/*	NSConnection.h
 | 
			
		||||
	Copyright (c) 1989-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
 | 
			
		||||
@class NSMutableData, NSDistantObject, NSException, NSData, NSString, NSNumber;
 | 
			
		||||
@class NSPort, NSRunLoop, NSPortNameServer, NSDictionary<KeyType, ObjectType>, NSArray<ObjectType>;
 | 
			
		||||
@class NSDistantObjectRequest;
 | 
			
		||||
@protocol NSConnectionDelegate;
 | 
			
		||||
 | 
			
		||||
NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use NSXPCConnection instead", macosx(10.0, 10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0))
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("Use NSXPCConnection instead")
 | 
			
		||||
@interface NSConnection : NSObject {
 | 
			
		||||
    @private
 | 
			
		||||
    id		receivePort;
 | 
			
		||||
    id		sendPort;
 | 
			
		||||
    id          delegate;
 | 
			
		||||
    int32_t	busy;
 | 
			
		||||
    int32_t	localProxyCount;
 | 
			
		||||
    int32_t	waitCount;
 | 
			
		||||
    id		delayedRL;
 | 
			
		||||
    id		statistics;
 | 
			
		||||
    unsigned char isDead;
 | 
			
		||||
    unsigned char isValid;
 | 
			
		||||
    unsigned char wantsInvalid;
 | 
			
		||||
    unsigned char authGen:1;
 | 
			
		||||
    unsigned char authCheck:1;
 | 
			
		||||
    unsigned char _reserved1:1;
 | 
			
		||||
    unsigned char _reserved2:1;
 | 
			
		||||
    unsigned char doRequest:1;
 | 
			
		||||
    unsigned char isQueueing:1;
 | 
			
		||||
    unsigned char isMulti:1;
 | 
			
		||||
    unsigned char invalidateRP:1;
 | 
			
		||||
    id          ___1;
 | 
			
		||||
    id          ___2;
 | 
			
		||||
    id          runLoops;
 | 
			
		||||
    id		requestModes;
 | 
			
		||||
    id          rootObject;
 | 
			
		||||
    void *	registerInfo;
 | 
			
		||||
    id		replMode;
 | 
			
		||||
    id          classInfoImported;
 | 
			
		||||
    id		releasedProxies;
 | 
			
		||||
    id		reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSDictionary<NSString *, NSNumber *> *statistics;
 | 
			
		||||
 | 
			
		||||
+ (NSArray<NSConnection *> *)allConnections;
 | 
			
		||||
 | 
			
		||||
+ (NSConnection *)defaultConnection API_DEPRECATED("", macos(10.0, 10.6)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)connectionWithRegisteredName:(NSString *)name host:(nullable NSString *)hostName;
 | 
			
		||||
+ (nullable instancetype)connectionWithRegisteredName:(NSString *)name host:(nullable NSString *)hostName usingNameServer:(NSPortNameServer *)server;
 | 
			
		||||
+ (nullable NSDistantObject *)rootProxyForConnectionWithRegisteredName:(NSString *)name host:(nullable NSString *)hostName;
 | 
			
		||||
+ (nullable NSDistantObject *)rootProxyForConnectionWithRegisteredName:(NSString *)name host:(nullable NSString *)hostName usingNameServer:(NSPortNameServer *)server;
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)serviceConnectionWithName:(NSString *)name rootObject:(id)root usingNameServer:(NSPortNameServer *)server API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (nullable instancetype)serviceConnectionWithName:(NSString *)name rootObject:(id)root API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property NSTimeInterval requestTimeout;
 | 
			
		||||
@property NSTimeInterval replyTimeout;
 | 
			
		||||
@property (nullable, retain) id rootObject;
 | 
			
		||||
@property (nullable, assign) id<NSConnectionDelegate> delegate;
 | 
			
		||||
@property BOOL independentConversationQueueing;
 | 
			
		||||
@property (readonly, getter=isValid) BOOL valid;
 | 
			
		||||
 | 
			
		||||
@property (readonly, retain) NSDistantObject *rootProxy;
 | 
			
		||||
 | 
			
		||||
- (void)invalidate;
 | 
			
		||||
 | 
			
		||||
- (void)addRequestMode:(NSString *)rmode;
 | 
			
		||||
- (void)removeRequestMode:(NSString *)rmode;
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *requestModes;
 | 
			
		||||
 | 
			
		||||
- (BOOL)registerName:(nullable NSString *) name;
 | 
			
		||||
- (BOOL)registerName:(nullable NSString *) name withNameServer:(NSPortNameServer *)server;
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)connectionWithReceivePort:(nullable NSPort *)receivePort sendPort:(nullable NSPort *)sendPort;
 | 
			
		||||
 | 
			
		||||
+ (nullable id)currentConversation;
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithReceivePort:(nullable NSPort *)receivePort sendPort:(nullable NSPort *)sendPort;
 | 
			
		||||
 | 
			
		||||
@property (readonly, retain) NSPort *sendPort;
 | 
			
		||||
@property (readonly, retain) NSPort *receivePort;
 | 
			
		||||
 | 
			
		||||
- (void)enableMultipleThreads;
 | 
			
		||||
@property (readonly) BOOL multipleThreadsEnabled;
 | 
			
		||||
 | 
			
		||||
- (void)addRunLoop:(NSRunLoop *)runloop;
 | 
			
		||||
- (void)removeRunLoop:(NSRunLoop *)runloop;
 | 
			
		||||
 | 
			
		||||
- (void)runInNewThread;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray *remoteObjects;
 | 
			
		||||
@property (readonly, copy) NSArray *localObjects;
 | 
			
		||||
 | 
			
		||||
// NSPort subclasses should use this method to ask a connection object to dispatch Distributed Objects component data received over the wire. This will decode the data, authenticate, and send the message.
 | 
			
		||||
- (void)dispatchWithComponents:(NSArray *)components API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSConnectionReplyMode NS_SWIFT_UNAVAILABLE("Use NSXPCConnection instead") API_DEPRECATED("Use NSXPCConnection instead", macosx(10.0, 10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0));
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSConnectionDidDieNotification NS_SWIFT_UNAVAILABLE("Use NSXPCConnection instead") API_DEPRECATED("Use NSXPCConnection instead", macosx(10.0, 10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use NSXPCConnection instead", macosx(10.0, 10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0))
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("Use NSXPCConnection instead")
 | 
			
		||||
@protocol NSConnectionDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
// Use the NSConnectionDidInitializeNotification notification instead
 | 
			
		||||
// of this delegate method if possible.
 | 
			
		||||
- (BOOL)makeNewConnection:(NSConnection *)conn sender:(NSConnection *)ancestor;
 | 
			
		||||
 | 
			
		||||
// Use the NSConnectionDidInitializeNotification notification instead
 | 
			
		||||
// of this delegate method if possible.
 | 
			
		||||
- (BOOL)connection:(NSConnection *)ancestor shouldMakeNewConnection:(NSConnection *)conn;
 | 
			
		||||
 | 
			
		||||
- (NSData *)authenticationDataForComponents:(NSArray *)components;
 | 
			
		||||
- (BOOL)authenticateComponents:(NSArray *)components withData:(NSData *)signature;
 | 
			
		||||
 | 
			
		||||
- (id)createConversationForConnection:(NSConnection *)conn;
 | 
			
		||||
 | 
			
		||||
- (BOOL)connection:(NSConnection *)connection handleRequest:(NSDistantObjectRequest *)doreq;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSFailedAuthenticationException NS_SWIFT_UNAVAILABLE("Use NSXPCConnection instead") API_DEPRECATED("Use NSXPCConnection instead", macosx(10.0, 10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0));
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSConnectionDidInitializeNotification NS_SWIFT_UNAVAILABLE("Use NSXPCConnection instead") API_DEPRECATED("Use NSXPCConnection instead", macosx(10.0, 10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0));
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use NSXPCConnection instead", macosx(10.0, 10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0))
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("Use NSXPCConnection instead")
 | 
			
		||||
@interface NSDistantObjectRequest : NSObject
 | 
			
		||||
 | 
			
		||||
@property (readonly, retain) NSInvocation *invocation;
 | 
			
		||||
@property (readonly, retain) NSConnection *connection;
 | 
			
		||||
@property (readonly, retain) id conversation;
 | 
			
		||||
- (void)replyWithException:(nullable NSException *)exception;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,241 @@
 | 
			
		||||
/*	NSData.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSRange.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSURL, NSError;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/****************	Read/Write Options	****************/
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDataReadingOptions) {
 | 
			
		||||
    NSDataReadingMappedIfSafe =   1UL << 0,	// Hint to map the file in if possible and safe
 | 
			
		||||
    NSDataReadingUncached = 1UL << 1,	// Hint to get the file not to be cached in the kernel
 | 
			
		||||
    NSDataReadingMappedAlways API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)) = 1UL << 3,	// Hint to map the file in if possible. This takes precedence over NSDataReadingMappedIfSafe if both are given.
 | 
			
		||||
    
 | 
			
		||||
    // Options with old names for NSData reading methods. Please stop using these old names.
 | 
			
		||||
    NSDataReadingMapped API_DEPRECATED_WITH_REPLACEMENT("NSDataReadingMappedIfSafe", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED)) = NSDataReadingMappedIfSafe,	// Deprecated name for NSDataReadingMappedIfSafe
 | 
			
		||||
    NSMappedRead API_DEPRECATED_WITH_REPLACEMENT("NSDataReadingMapped", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED)) = NSDataReadingMapped,			// Deprecated name for NSDataReadingMapped
 | 
			
		||||
    NSUncachedRead API_DEPRECATED_WITH_REPLACEMENT("NSDataReadingUncached", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED)) = NSDataReadingUncached		// Deprecated name for NSDataReadingUncached
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDataWritingOptions) {
 | 
			
		||||
    NSDataWritingAtomic = 1UL << 0,	// Hint to use auxiliary file when saving; equivalent to atomically:YES
 | 
			
		||||
    NSDataWritingWithoutOverwriting API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)) = 1UL << 1, // Hint to  prevent overwriting an existing file. Cannot be combined with NSDataWritingAtomic.
 | 
			
		||||
 | 
			
		||||
    NSDataWritingFileProtectionNone API_AVAILABLE(macos(11.0), ios(4.0), watchos(2.0), tvos(9.0))                                  = 0x10000000,
 | 
			
		||||
    NSDataWritingFileProtectionComplete API_AVAILABLE(macos(11.0), ios(4.0), watchos(2.0), tvos(9.0))                              = 0x20000000,
 | 
			
		||||
    NSDataWritingFileProtectionCompleteUnlessOpen API_AVAILABLE(macos(11.0), ios(5.0), watchos(2.0), tvos(9.0))                    = 0x30000000,
 | 
			
		||||
    NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication API_AVAILABLE(macos(11.0), ios(5.0), watchos(2.0), tvos(9.0))  = 0x40000000,
 | 
			
		||||
    NSDataWritingFileProtectionMask API_AVAILABLE(macos(11.0), ios(4.0), watchos(2.0), tvos(9.0))                                  = 0xf0000000,
 | 
			
		||||
 | 
			
		||||
    // Options with old names for NSData writing methods. Please stop using these old names.
 | 
			
		||||
    NSAtomicWrite API_DEPRECATED_WITH_REPLACEMENT("NSDataWritingAtomic", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED)) = NSDataWritingAtomic	    // Deprecated name for NSDataWritingAtomic
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/****************	Data Search Options	****************/
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDataSearchOptions) {
 | 
			
		||||
    NSDataSearchBackwards = 1UL << 0,
 | 
			
		||||
    NSDataSearchAnchored = 1UL << 1
 | 
			
		||||
} API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/****************        Base 64 Options	****************/
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDataBase64EncodingOptions) {
 | 
			
		||||
    // Use zero or one of the following to control the maximum line length after which a line ending is inserted. No line endings are inserted by default.
 | 
			
		||||
    NSDataBase64Encoding64CharacterLineLength = 1UL << 0,
 | 
			
		||||
    NSDataBase64Encoding76CharacterLineLength = 1UL << 1,
 | 
			
		||||
 | 
			
		||||
    // Use zero or more of the following to specify which kind of line ending is inserted. The default line ending is CR LF.
 | 
			
		||||
    NSDataBase64EncodingEndLineWithCarriageReturn = 1UL << 4,
 | 
			
		||||
    NSDataBase64EncodingEndLineWithLineFeed = 1UL << 5,
 | 
			
		||||
 | 
			
		||||
} API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDataBase64DecodingOptions) {
 | 
			
		||||
    // Use the following option to modify the decoding algorithm so that it ignores unknown non-Base64 bytes, including line ending characters.
 | 
			
		||||
    NSDataBase64DecodingIgnoreUnknownCharacters = 1UL << 0
 | 
			
		||||
} API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/****************	Immutable Data		****************/
 | 
			
		||||
 | 
			
		||||
@interface NSData : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger length;
 | 
			
		||||
/*
 | 
			
		||||
 The -bytes method returns a pointer to a contiguous region of memory managed by the receiver.
 | 
			
		||||
 If the regions of memory represented by the receiver are already contiguous, it does so in O(1) time, otherwise it may take longer
 | 
			
		||||
 Using -enumerateByteRangesUsingBlock: will be efficient for both contiguous and discontiguous data.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) const void *bytes NS_RETURNS_INNER_POINTER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSData (NSExtendedData)
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *description;
 | 
			
		||||
- (void)getBytes:(void *)buffer length:(NSUInteger)length;
 | 
			
		||||
- (void)getBytes:(void *)buffer range:(NSRange)range;
 | 
			
		||||
- (BOOL)isEqualToData:(NSData *)other;
 | 
			
		||||
- (NSData *)subdataWithRange:(NSRange)range;
 | 
			
		||||
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile;
 | 
			
		||||
- (BOOL)writeToURL:(NSURL *)url atomically:(BOOL)atomically; // the atomically flag is ignored if the url is not of a type the supports atomic writes
 | 
			
		||||
- (BOOL)writeToFile:(NSString *)path options:(NSDataWritingOptions)writeOptionsMask error:(NSError **)errorPtr;
 | 
			
		||||
- (BOOL)writeToURL:(NSURL *)url options:(NSDataWritingOptions)writeOptionsMask error:(NSError **)errorPtr;
 | 
			
		||||
- (NSRange)rangeOfData:(NSData *)dataToFind options:(NSDataSearchOptions)mask range:(NSRange)searchRange API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 'block' is called once for each contiguous region of memory in the receiver (once total for contiguous NSDatas), until either all bytes have been enumerated, or the 'stop' parameter is set to YES.
 | 
			
		||||
 */
 | 
			
		||||
- (void) enumerateByteRangesUsingBlock:(void (NS_NOESCAPE ^)(const void *bytes, NSRange byteRange, BOOL *stop))block API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSData (NSDataCreation)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)data;
 | 
			
		||||
+ (instancetype)dataWithBytes:(nullable const void *)bytes length:(NSUInteger)length;
 | 
			
		||||
+ (instancetype)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length;
 | 
			
		||||
+ (instancetype)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
 | 
			
		||||
+ (nullable instancetype)dataWithContentsOfFile:(NSString *)path options:(NSDataReadingOptions)readOptionsMask error:(NSError **)errorPtr;
 | 
			
		||||
+ (nullable instancetype)dataWithContentsOfURL:(NSURL *)url options:(NSDataReadingOptions)readOptionsMask error:(NSError **)errorPtr;
 | 
			
		||||
+ (nullable instancetype)dataWithContentsOfFile:(NSString *)path;
 | 
			
		||||
+ (nullable instancetype)dataWithContentsOfURL:(NSURL *)url;
 | 
			
		||||
- (instancetype)initWithBytes:(nullable const void *)bytes length:(NSUInteger)length;
 | 
			
		||||
- (instancetype)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length;
 | 
			
		||||
- (instancetype)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)b;
 | 
			
		||||
- (instancetype)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length deallocator:(nullable void (^)(void *bytes, NSUInteger length))deallocator API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (nullable instancetype)initWithContentsOfFile:(NSString *)path options:(NSDataReadingOptions)readOptionsMask error:(NSError **)errorPtr;
 | 
			
		||||
- (nullable instancetype)initWithContentsOfURL:(NSURL *)url options:(NSDataReadingOptions)readOptionsMask error:(NSError **)errorPtr;
 | 
			
		||||
- (nullable instancetype)initWithContentsOfFile:(NSString *)path;
 | 
			
		||||
- (nullable instancetype)initWithContentsOfURL:(NSURL *)url;
 | 
			
		||||
- (instancetype)initWithData:(NSData *)data;
 | 
			
		||||
+ (instancetype)dataWithData:(NSData *)data;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSData (NSDataBase64Encoding)
 | 
			
		||||
 | 
			
		||||
/* Create an NSData from a Base-64 encoded NSString using the given options. By default, returns nil when the input is not recognized as valid Base-64.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithBase64EncodedString:(NSString *)base64String options:(NSDataBase64DecodingOptions)options API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Create a Base-64 encoded NSString from the receiver's contents using the given options.
 | 
			
		||||
*/
 | 
			
		||||
- (NSString *)base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)options API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Create an NSData from a Base-64, UTF-8 encoded NSData. By default, returns nil when the input is not recognized as valid Base-64.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithBase64EncodedData:(NSData *)base64Data options:(NSDataBase64DecodingOptions)options API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Create a Base-64, UTF-8 encoded NSData from the receiver's contents using the given options.
 | 
			
		||||
*/
 | 
			
		||||
- (NSData *)base64EncodedDataWithOptions:(NSDataBase64EncodingOptions)options API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Various algorithms provided for compression APIs. See NSData and NSMutableData.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSDataCompressionAlgorithm) {
 | 
			
		||||
    
 | 
			
		||||
    // LZFSE is the recommended compression algorithm if you don't have a specific reason to use another algorithm. Note that LZFSE is intended for use with Apple devices only. This algorithm generally compresses better than Zlib, but not as well as LZMA. It is generally slower than LZ4.
 | 
			
		||||
    NSDataCompressionAlgorithmLZFSE = 0,
 | 
			
		||||
    
 | 
			
		||||
    // LZ4 is appropriate if compression speed is critical. LZ4 generally sacrifices compression ratio in order to achieve its greater speed.
 | 
			
		||||
    // This implementation of LZ4 makes a small modification to the standard format, which is described in greater detail in <compression.h>.
 | 
			
		||||
    NSDataCompressionAlgorithmLZ4,
 | 
			
		||||
    
 | 
			
		||||
    // LZMA is appropriate if compression ratio is critical and memory usage and compression speed are not a factor. LZMA is an order of magnitude slower for both compression and decompression than other algorithms. It can also use a very large amount of memory, so if you need to compress large amounts of data on embedded devices with limited memory you should probably avoid LZMA.
 | 
			
		||||
    // Encoding uses LZMA level 6 only, but decompression works with any compression level.
 | 
			
		||||
    NSDataCompressionAlgorithmLZMA,
 | 
			
		||||
    
 | 
			
		||||
    // Zlib is appropriate if you want a good balance between compression speed and compression ratio, but only if you need interoperability with non-Apple platforms. Otherwise, LZFSE is generally a better choice than Zlib.
 | 
			
		||||
    // Encoding uses Zlib level 5 only, but decompression works with any compression level. It uses the raw DEFLATE format as described in IETF RFC 1951.
 | 
			
		||||
    NSDataCompressionAlgorithmZlib,
 | 
			
		||||
    
 | 
			
		||||
} API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
@interface NSData (NSDataCompression)
 | 
			
		||||
 | 
			
		||||
/* These methods return a compressed or decompressed version of the receiver using the specified algorithm.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable instancetype)decompressedDataUsingAlgorithm:(NSDataCompressionAlgorithm)algorithm error:(NSError **)error API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
- (nullable instancetype)compressedDataUsingAlgorithm:(NSDataCompressionAlgorithm)algorithm error:(NSError **)error API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSData (NSDeprecated)
 | 
			
		||||
 | 
			
		||||
- (void)getBytes:(void *)buffer API_DEPRECATED("This method is unsafe because it could potentially cause buffer overruns. Use -getBytes:length: instead.", macos(10.0,10.10), ios(2.0,8.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
+ (nullable id)dataWithContentsOfMappedFile:(NSString *)path API_DEPRECATED("Use +dataWithContentsOfURL:options:error: and NSDataReadingMappedIfSafe or NSDataReadingMappedAlways instead.", macos(10.0,10.10), ios(2.0,8.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (nullable id)initWithContentsOfMappedFile:(NSString *)path  API_DEPRECATED("Use -initWithContentsOfURL:options:error: and NSDataReadingMappedIfSafe or NSDataReadingMappedAlways instead.", macos(10.0,10.10), ios(2.0,8.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
/* These methods first appeared in NSData.h on OS X 10.9 and iOS 7.0. They are deprecated in the same releases in favor of the methods in the NSDataBase64Encoding category. However, these methods have existed for several releases, so they may be used for applications targeting releases prior to OS X 10.9 and iOS 7.0.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)initWithBase64Encoding:(NSString *)base64String API_DEPRECATED("Use initWithBase64EncodedString:options: instead", macos(10.6,10.9), ios(4.0,7.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (NSString *)base64Encoding API_DEPRECATED("Use base64EncodedStringWithOptions: instead", macos(10.6,10.9), ios(4.0,7.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/****************	Mutable Data		****************/
 | 
			
		||||
 | 
			
		||||
@interface NSMutableData : NSData
 | 
			
		||||
 | 
			
		||||
@property (readonly) void *mutableBytes NS_RETURNS_INNER_POINTER;
 | 
			
		||||
@property NSUInteger length;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableData (NSExtendedMutableData)
 | 
			
		||||
 | 
			
		||||
- (void)appendBytes:(const void *)bytes length:(NSUInteger)length;
 | 
			
		||||
- (void)appendData:(NSData *)other;
 | 
			
		||||
- (void)increaseLengthBy:(NSUInteger)extraLength;
 | 
			
		||||
- (void)replaceBytesInRange:(NSRange)range withBytes:(const void *)bytes;
 | 
			
		||||
- (void)resetBytesInRange:(NSRange)range;
 | 
			
		||||
- (void)setData:(NSData *)data;
 | 
			
		||||
- (void)replaceBytesInRange:(NSRange)range withBytes:(nullable const void *)replacementBytes length:(NSUInteger)replacementLength;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableData (NSMutableDataCreation)
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)dataWithCapacity:(NSUInteger)aNumItems;
 | 
			
		||||
+ (nullable instancetype)dataWithLength:(NSUInteger)length;
 | 
			
		||||
- (nullable instancetype)initWithCapacity:(NSUInteger)capacity;
 | 
			
		||||
- (nullable instancetype)initWithLength:(NSUInteger)length;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableData (NSMutableDataCompression)
 | 
			
		||||
 | 
			
		||||
/* These methods compress or decompress the receiver's contents in-place using the specified algorithm. If the operation is not successful, these methods leave the receiver unchanged..
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)decompressUsingAlgorithm:(NSDataCompressionAlgorithm)algorithm error:(NSError **)error API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
- (BOOL)compressUsingAlgorithm:(NSDataCompressionAlgorithm)algorithm error:(NSError **)error API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/****************	    Purgeable Data	****************/
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSPurgeableData : NSMutableData <NSDiscardableContent> {
 | 
			
		||||
@private
 | 
			
		||||
    NSUInteger _length;
 | 
			
		||||
    int32_t _accessCount;
 | 
			
		||||
    uint8_t _private[32];
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,68 @@
 | 
			
		||||
/*	NSDate.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
 | 
			
		||||
@class NSString;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSSystemClockDidChangeNotification API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
typedef double NSTimeInterval;
 | 
			
		||||
 | 
			
		||||
#define NSTimeIntervalSince1970  978307200.0
 | 
			
		||||
 | 
			
		||||
@interface NSDate : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSTimeInterval timeIntervalSinceReferenceDate;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithTimeIntervalSinceReferenceDate:(NSTimeInterval)ti NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDate (NSExtendedDate)
 | 
			
		||||
 | 
			
		||||
- (NSTimeInterval)timeIntervalSinceDate:(NSDate *)anotherDate;
 | 
			
		||||
@property (readonly) NSTimeInterval timeIntervalSinceNow;
 | 
			
		||||
@property (readonly) NSTimeInterval timeIntervalSince1970;
 | 
			
		||||
 | 
			
		||||
- (id)addTimeInterval:(NSTimeInterval)seconds API_DEPRECATED("Use dateByAddingTimeInterval instead", macos(10.0,10.6), ios(2.0,4.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (instancetype)dateByAddingTimeInterval:(NSTimeInterval)ti API_AVAILABLE(macos(10.6), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (NSDate *)earlierDate:(NSDate *)anotherDate;
 | 
			
		||||
- (NSDate *)laterDate:(NSDate *)anotherDate;
 | 
			
		||||
- (NSComparisonResult)compare:(NSDate *)other;
 | 
			
		||||
- (BOOL)isEqualToDate:(NSDate *)otherDate;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *description;
 | 
			
		||||
- (NSString *)descriptionWithLocale:(nullable id)locale;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly) NSTimeInterval timeIntervalSinceReferenceDate;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDate (NSDateCreation)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)date;
 | 
			
		||||
+ (instancetype)dateWithTimeIntervalSinceNow:(NSTimeInterval)secs;
 | 
			
		||||
+ (instancetype)dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)ti;
 | 
			
		||||
+ (instancetype)dateWithTimeIntervalSince1970:(NSTimeInterval)secs;
 | 
			
		||||
+ (instancetype)dateWithTimeInterval:(NSTimeInterval)secsToBeAdded sinceDate:(NSDate *)date;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, copy) NSDate *distantFuture;
 | 
			
		||||
@property (class, readonly, copy) NSDate *distantPast;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, copy) NSDate *now API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithTimeIntervalSinceNow:(NSTimeInterval)secs;
 | 
			
		||||
- (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)secs;
 | 
			
		||||
- (instancetype)initWithTimeInterval:(NSTimeInterval)secsToBeAdded sinceDate:(NSDate *)date;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,153 @@
 | 
			
		||||
/*	NSDateComponentsFormatter.h
 | 
			
		||||
	Copyright (c) 2014-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSFormatter.h>
 | 
			
		||||
#import <Foundation/NSCalendar.h>
 | 
			
		||||
#import <Foundation/NSNumberFormatter.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSDateComponentsFormatterUnitsStyle) {
 | 
			
		||||
    NSDateComponentsFormatterUnitsStylePositional = 0, // "1:10; may fall back to abbreviated units in some cases, e.g. 3d"
 | 
			
		||||
    NSDateComponentsFormatterUnitsStyleAbbreviated, // "1h 10m"
 | 
			
		||||
    NSDateComponentsFormatterUnitsStyleShort, // "1 hr, 10 min"
 | 
			
		||||
    NSDateComponentsFormatterUnitsStyleFull, // "1 hour, 10 minutes"
 | 
			
		||||
    NSDateComponentsFormatterUnitsStyleSpellOut, // "One hour, ten minutes"
 | 
			
		||||
    NSDateComponentsFormatterUnitsStyleBrief API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) // "1hr 10min" - Brief is shorter than Short (e.g. in English, it removes the comma)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDateComponentsFormatterZeroFormattingBehavior) {
 | 
			
		||||
    NSDateComponentsFormatterZeroFormattingBehaviorNone = (0), //drop none, pad none
 | 
			
		||||
    NSDateComponentsFormatterZeroFormattingBehaviorDefault = (1 << 0), //Positional units: drop leading zeros, pad other zeros. All others: drop all zeros.
 | 
			
		||||
 | 
			
		||||
    NSDateComponentsFormatterZeroFormattingBehaviorDropLeading = (1 << 1), // Off: "0h 10m", On: "10m"
 | 
			
		||||
    NSDateComponentsFormatterZeroFormattingBehaviorDropMiddle = (1 << 2), // Off: "1h 0m 10s", On: "1h 10s"
 | 
			
		||||
    NSDateComponentsFormatterZeroFormattingBehaviorDropTrailing = (1 << 3), // Off: "1h 0m", On: "1h"
 | 
			
		||||
    NSDateComponentsFormatterZeroFormattingBehaviorDropAll = (NSDateComponentsFormatterZeroFormattingBehaviorDropLeading | NSDateComponentsFormatterZeroFormattingBehaviorDropMiddle | NSDateComponentsFormatterZeroFormattingBehaviorDropTrailing),
 | 
			
		||||
 | 
			
		||||
    NSDateComponentsFormatterZeroFormattingBehaviorPad = (1 << 16), // Off: "1:0:10", On: "01:00:10" 
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* NSDateComponentsFormatter provides locale-correct and flexible string formatting of quantities of time, such as "1 day" or "1h 10m", as specified by NSDateComponents. For formatting intervals of time (such as "2PM to 5PM"), see NSDateIntervalFormatter. NSDateComponentsFormatter is thread-safe, in that calling methods on it from multiple threads will not cause crashes or incorrect results, but it makes no attempt to prevent confusion when one thread sets something and another thread isn't expecting it to change.
 | 
			
		||||
 */
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSDateComponentsFormatter : NSFormatter {
 | 
			
		||||
    @private
 | 
			
		||||
    pthread_mutex_t _lock;
 | 
			
		||||
    void *_fmt;
 | 
			
		||||
    void *_unused;
 | 
			
		||||
    NSString *_fmtLocaleIdent;
 | 
			
		||||
    NSCalendar *_calendar;
 | 
			
		||||
    NSDate *_referenceDate;
 | 
			
		||||
    NSNumberFormatter *_unitFormatter;
 | 
			
		||||
    NSCalendarUnit _allowedUnits;
 | 
			
		||||
    NSFormattingContext _formattingContext;
 | 
			
		||||
    NSDateComponentsFormatterUnitsStyle _unitsStyle;
 | 
			
		||||
    NSDateComponentsFormatterZeroFormattingBehavior _zeroFormattingBehavior;
 | 
			
		||||
    NSInteger _maximumUnitCount;
 | 
			
		||||
    BOOL _allowsFractionalUnits;
 | 
			
		||||
    BOOL _collapsesLargestUnit;
 | 
			
		||||
    BOOL _includesApproximationPhrase;
 | 
			
		||||
    BOOL _includesTimeRemainingPhrase;
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* 'obj' must be an instance of NSDateComponents.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSString *)stringForObjectValue:(nullable id)obj;
 | 
			
		||||
 | 
			
		||||
/* Convenience method for formatting an NSDateComponents object. This calculates the count of the unit(s) starting from referenceDate.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSString *)stringFromDateComponents:(NSDateComponents *)components;
 | 
			
		||||
 | 
			
		||||
/* Normally, NSDateComponentsFormatter will calculate as though counting from referenceDate (e.g. in February, 1 month formatted as a number of days will be 28). -stringFromDate:toDate: calculates from the passed-in startDate instead.
 | 
			
		||||
 
 | 
			
		||||
   See 'allowedUnits' for how the default set of allowed units differs from -stringFromDateComponents:.
 | 
			
		||||
 
 | 
			
		||||
   Note that this is still formatting the quantity of time between the dates, not the pair of dates itself. For strings like "Feb 22nd - Feb 28th", use NSDateIntervalFormatter.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSString *)stringFromDate:(NSDate *)startDate toDate:(NSDate *)endDate;
 | 
			
		||||
 | 
			
		||||
/* Convenience method for formatting a number of seconds. See 'allowedUnits' for how the default set of allowed units differs from -stringFromDateComponents:. This calculates the count of the unit(s) from referenceDate to the passed-in time interval.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSString *)stringFromTimeInterval:(NSTimeInterval)ti;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
+ (nullable NSString *)localizedStringFromDateComponents:(NSDateComponents *)components unitsStyle:(NSDateComponentsFormatterUnitsStyle) unitsStyle;
 | 
			
		||||
 | 
			
		||||
/* Choose how to indicate units. For example, 1h 10m vs 1:10. Default is NSDateComponentsFormatterUnitsStylePositional.
 | 
			
		||||
 */
 | 
			
		||||
@property NSDateComponentsFormatterUnitsStyle unitsStyle;
 | 
			
		||||
 | 
			
		||||
/* Bitmask of units to include. Set to 0 to get the default behavior. Note that, especially if the maximum number of units is low, unit collapsing is on, or zero dropping is on, not all allowed units may actually be used for a given NSDateComponents. Default value is the components of the passed-in NSDateComponents object, or years | months | weeks | days | hours | minutes | seconds if passed an NSTimeInterval or pair of NSDates.
 | 
			
		||||
 
 | 
			
		||||
   Allowed units are:
 | 
			
		||||
 
 | 
			
		||||
    NSCalendarUnitYear
 | 
			
		||||
    NSCalendarUnitMonth
 | 
			
		||||
    NSCalendarUnitWeekOfMonth (used to mean "quantity of weeks")
 | 
			
		||||
    NSCalendarUnitDay
 | 
			
		||||
    NSCalendarUnitHour
 | 
			
		||||
    NSCalendarUnitMinute
 | 
			
		||||
    NSCalendarUnitSecond
 | 
			
		||||
 
 | 
			
		||||
   Specifying any other NSCalendarUnits will result in an exception.
 | 
			
		||||
 */
 | 
			
		||||
@property NSCalendarUnit allowedUnits;
 | 
			
		||||
 | 
			
		||||
/* Bitmask specifying how to handle zeros in units. This includes both padding and dropping zeros so that a consistent number digits are displayed, causing updating displays to remain more stable. Default is NSDateComponentsFormatterZeroFormattingBehaviorDefault.
 | 
			
		||||
 
 | 
			
		||||
   If the combination of zero formatting behavior and style would lead to ambiguous date formats (for example, 1:10 meaning 1 hour, 10 seconds), NSDateComponentsFormatter will throw an exception.
 | 
			
		||||
 */
 | 
			
		||||
@property NSDateComponentsFormatterZeroFormattingBehavior zeroFormattingBehavior;
 | 
			
		||||
 | 
			
		||||
/* Specifies the locale and calendar to use for formatting date components that do not themselves have calendars. Defaults to NSAutoupdatingCurrentCalendar. If set to nil, uses the gregorian calendar with the en_US_POSIX locale.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, copy) NSCalendar *calendar;
 | 
			
		||||
 | 
			
		||||
/*  Where units have variable length (number of days in a month, number of hours in a day, etc...), NSDateComponentsFormatter will calculate as though counting from the date specified by the referenceDate in the appropriate calendar. Defaults to [NSDate dateWithTimeIntervalSinceReferenceDate:0] at the time of the -stringForObjectValue: call if not set. Set to nil to get the default behavior.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, copy) NSDate *referenceDate API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
/* Choose whether non-integer units should be used to handle display of values that can't be exactly represented with the allowed units. For example, if minutes aren't allowed, then "1h 30m" could be formatted as "1.5h". Default is NO.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL allowsFractionalUnits;
 | 
			
		||||
 | 
			
		||||
/* Choose whether or not, and at which point, to round small units in large values to zero.
 | 
			
		||||
   Examples:
 | 
			
		||||
    1h 10m 30s, maximumUnitCount set to 0: "1h 10m 30s"
 | 
			
		||||
    1h 10m 30s, maximumUnitCount set to 2: "1h 10m"
 | 
			
		||||
    10m 30s, maximumUnitCount set to 0: "10m 30s"
 | 
			
		||||
    10m 30s, maximumUnitCount set to 2: "10m 30s"
 | 
			
		||||
 | 
			
		||||
   Default is 0, which is interpreted as unlimited.
 | 
			
		||||
 */
 | 
			
		||||
@property NSInteger maximumUnitCount;
 | 
			
		||||
 | 
			
		||||
/* Choose whether to express largest units just above the threshold for the next lowest unit as a larger quantity of the lower unit. For example: "1m 3s" vs "63s". Default is NO.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL collapsesLargestUnit;
 | 
			
		||||
 | 
			
		||||
/* Choose whether to indicate that the allowed units/insignificant units choices lead to inexact results. In some languages, simply prepending "about " to the string will produce incorrect results; this handles those cases correctly. Default is NO.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL includesApproximationPhrase;
 | 
			
		||||
 | 
			
		||||
/* Choose whether to produce strings like "35 minutes remaining". Default is NO.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL includesTimeRemainingPhrase;
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
   Not yet supported.
 | 
			
		||||
 */
 | 
			
		||||
@property NSFormattingContext formattingContext;
 | 
			
		||||
 | 
			
		||||
/* NSDateComponentsFormatter currently only implements formatting, not parsing. Until it implements parsing, this will always return NO.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)getObjectValue:(out id _Nullable * _Nullable)obj forString:(NSString *)string errorDescription:(out NSString * _Nullable * _Nullable)error;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,127 @@
 | 
			
		||||
/*	NSDateFormatter.h
 | 
			
		||||
	Copyright (c) 1995-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSFormatter.h>
 | 
			
		||||
#include <CoreFoundation/CFDateFormatter.h>
 | 
			
		||||
 | 
			
		||||
@class NSLocale, NSDate, NSCalendar, NSTimeZone, NSError, NSArray<ObjectType>, NSMutableDictionary, NSString;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
#if !defined(NS_CALENDAR_ENUM_DEPRECATED)
 | 
			
		||||
#if 1 || NS_ENABLE_CALENDAR_DEPRECATIONS
 | 
			
		||||
#define NS_CALENDAR_ENUM_DEPRECATED(A, B, C, D, ...) NS_ENUM_DEPRECATED(A, B, C, D, __VA_ARGS__)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED(A, B, C, D, ...) NS_DEPRECATED(A, B, C, D, __VA_ARGS__)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED_MAC(A, B, ...) NS_DEPRECATED_MAC(A, B, __VA_ARGS__)
 | 
			
		||||
#else
 | 
			
		||||
#define NS_CALENDAR_ENUM_DEPRECATED(A, B, C, D, ...) NS_ENUM_AVAILABLE(A, C)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED(A, B, C, D, ...) NS_AVAILABLE(A, C)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED_MAC(A, B, ...) NS_AVAILABLE_MAC(A)
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSDateFormatter : NSFormatter {
 | 
			
		||||
@private
 | 
			
		||||
    NSMutableDictionary *_attributes;
 | 
			
		||||
    CFDateFormatterRef _formatter;
 | 
			
		||||
    NSUInteger _counter;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property NSFormattingContext formattingContext API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); // default is NSFormattingContextUnknown
 | 
			
		||||
 | 
			
		||||
// - (id)init; // designated initializer
 | 
			
		||||
 | 
			
		||||
// Report the used range of the string and an NSError, in addition to the usual stuff from NSFormatter
 | 
			
		||||
 | 
			
		||||
- (BOOL)getObjectValue:(out id _Nullable * _Nullable)obj forString:(NSString *)string range:(inout nullable NSRange *)rangep error:(out NSError **)error;
 | 
			
		||||
 | 
			
		||||
// Even though NSDateFormatter responds to the usual NSFormatter methods,
 | 
			
		||||
//   here are some convenience methods which are a little more obvious.
 | 
			
		||||
 | 
			
		||||
- (NSString *)stringFromDate:(NSDate *)date;
 | 
			
		||||
- (nullable NSDate *)dateFromString:(NSString *)string;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSDateFormatterStyle) {    // date and time format styles
 | 
			
		||||
    NSDateFormatterNoStyle = kCFDateFormatterNoStyle,
 | 
			
		||||
    NSDateFormatterShortStyle = kCFDateFormatterShortStyle,
 | 
			
		||||
    NSDateFormatterMediumStyle = kCFDateFormatterMediumStyle,
 | 
			
		||||
    NSDateFormatterLongStyle = kCFDateFormatterLongStyle,
 | 
			
		||||
    NSDateFormatterFullStyle = kCFDateFormatterFullStyle
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSDateFormatterBehavior) {
 | 
			
		||||
    NSDateFormatterBehaviorDefault = 0,
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
    NSDateFormatterBehavior10_0 = 1000,
 | 
			
		||||
#endif
 | 
			
		||||
    NSDateFormatterBehavior10_4 = 1040,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
+ (NSString *)localizedStringFromDate:(NSDate *)date dateStyle:(NSDateFormatterStyle)dstyle timeStyle:(NSDateFormatterStyle)tstyle API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
+ (nullable NSString *)dateFormatFromTemplate:(NSString *)tmplate options:(NSUInteger)opts locale:(nullable NSLocale *)locale API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
	// no options defined, pass 0 for now
 | 
			
		||||
 | 
			
		||||
// Attributes of an NSDateFormatter
 | 
			
		||||
@property (class) NSDateFormatterBehavior defaultFormatterBehavior;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 A convenient way to generate an appropriate localized date format, and set it, in a single operation.
 | 
			
		||||
 | 
			
		||||
 Equivalent to, though not necessarily implemented as:
 | 
			
		||||
 formatter.dateFormat = [NSDateFormatter dateFormatFromTemplate:dateFormatTemplate options:0 locale:formatter.locale];
 | 
			
		||||
 | 
			
		||||
 Note that the template string is used only to specify which date format components should be included. Ordering and other text will not be preserved.
 | 
			
		||||
 The parameter is also not stored, or updated when the locale or other options change, just as with the ‘dateFormat’ property.
 | 
			
		||||
 */
 | 
			
		||||
- (void) setLocalizedDateFormatFromTemplate:(NSString *)dateFormatTemplate API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (null_resettable, copy) NSString *dateFormat;
 | 
			
		||||
@property NSDateFormatterStyle dateStyle;
 | 
			
		||||
@property NSDateFormatterStyle timeStyle;
 | 
			
		||||
@property (null_resettable, copy) NSLocale *locale;
 | 
			
		||||
@property BOOL generatesCalendarDates;
 | 
			
		||||
@property NSDateFormatterBehavior formatterBehavior;
 | 
			
		||||
@property (null_resettable, copy) NSTimeZone *timeZone;
 | 
			
		||||
@property (null_resettable, copy) NSCalendar *calendar;
 | 
			
		||||
@property (getter=isLenient) BOOL lenient;
 | 
			
		||||
@property (nullable, copy) NSDate *twoDigitStartDate;
 | 
			
		||||
@property (nullable, copy) NSDate *defaultDate;
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *eraSymbols;
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *monthSymbols;
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *shortMonthSymbols;
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *weekdaySymbols;
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *shortWeekdaySymbols;
 | 
			
		||||
@property (null_resettable, copy) NSString *AMSymbol;
 | 
			
		||||
@property (null_resettable, copy) NSString *PMSymbol;
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *longEraSymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *veryShortMonthSymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *standaloneMonthSymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *shortStandaloneMonthSymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *veryShortStandaloneMonthSymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *veryShortWeekdaySymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *standaloneWeekdaySymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *shortStandaloneWeekdaySymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *veryShortStandaloneWeekdaySymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *quarterSymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *shortQuarterSymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *standaloneQuarterSymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSString *> *shortStandaloneQuarterSymbols API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (nullable, copy) NSDate *gregorianStartDate API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property BOOL doesRelativeDateFormatting API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
@interface NSDateFormatter (NSDateFormatterCompatibility)
 | 
			
		||||
 | 
			
		||||
- (id)initWithDateFormat:(NSString *)format allowNaturalLanguage:(BOOL)flag API_DEPRECATED("Create an NSDateFormatter with `init` and set the dateFormat property instead.", macos(10.4, 10.9));
 | 
			
		||||
- (BOOL)allowsNaturalLanguage API_DEPRECATED("There is no replacement", macos(10.4, 10.9));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,64 @@
 | 
			
		||||
/*	NSDateInterval.h
 | 
			
		||||
	Copyright (c) 2015-2019, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
#import <Foundation/NSCoder.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0))
 | 
			
		||||
@interface NSDateInterval : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 NSDateInterval represents a closed date interval in the form of [startDate, endDate].  It is possible for the start and end dates to be the same with a duration of 0.  NSDateInterval does not support reverse intervals i.e. intervals where the duration is less than 0 and the end date occurs earlier in time than the start date.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSDate *startDate;
 | 
			
		||||
@property (readonly, copy) NSDate *endDate;
 | 
			
		||||
@property (readonly) NSTimeInterval duration;
 | 
			
		||||
 | 
			
		||||
// This method initializes an NSDateInterval object with start and end dates set to the current date and the duration set to 0.
 | 
			
		||||
- (instancetype)init;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
// This method will throw an exception if the duration is less than 0.
 | 
			
		||||
- (instancetype)initWithStartDate:(NSDate *)startDate duration:(NSTimeInterval)duration NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
// This method will throw an exception if the end date comes before the start date.
 | 
			
		||||
- (instancetype)initWithStartDate:(NSDate *)startDate endDate:(NSDate *)endDate;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 (NSComparisonResult)compare:(NSDateInterval *) prioritizes ordering by start date. If the start dates are equal, then it will order by duration.
 | 
			
		||||
 e.g.
 | 
			
		||||
    Given intervals a and b
 | 
			
		||||
        a.   |-----|
 | 
			
		||||
        b.      |-----|
 | 
			
		||||
 [a compare:b] would return NSOrderedAscending because a's startDate is earlier in time than b's start date.
 | 
			
		||||
 | 
			
		||||
 In the event that the start dates are equal, the compare method will attempt to order by duration.
 | 
			
		||||
 e.g.
 | 
			
		||||
    Given intervals c and d
 | 
			
		||||
        c.  |-----|
 | 
			
		||||
        d.  |---|
 | 
			
		||||
 [c compare:d] would result in NSOrderedDescending because c is longer than d.
 | 
			
		||||
 | 
			
		||||
 If both the start dates and the durations are equal, then the intervals are considered equal and NSOrderedSame is returned as the result.
 | 
			
		||||
 */
 | 
			
		||||
- (NSComparisonResult)compare:(NSDateInterval *)dateInterval;
 | 
			
		||||
 | 
			
		||||
- (BOOL)isEqualToDateInterval:(NSDateInterval *)dateInterval;
 | 
			
		||||
- (BOOL)intersectsDateInterval:(NSDateInterval *)dateInterval;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 This method returns an NSDateInterval object that represents the interval where the given date interval and the current instance intersect. In the event that there is no intersection, the method returns nil.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSDateInterval *)intersectionWithDateInterval:(NSDateInterval *)dateInterval;
 | 
			
		||||
 | 
			
		||||
- (BOOL)containsDate:(NSDate *)date;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,72 @@
 | 
			
		||||
/*	NSDateIntervalFormatter.h
 | 
			
		||||
        Copyright (c) 2013-2019, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSFormatter.h>
 | 
			
		||||
#import <Foundation/NSDateInterval.h>
 | 
			
		||||
#include <dispatch/dispatch.h>
 | 
			
		||||
@class NSLocale, NSCalendar, NSTimeZone, NSDate;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSDateIntervalFormatterStyle) {
 | 
			
		||||
    NSDateIntervalFormatterNoStyle = 0,
 | 
			
		||||
    NSDateIntervalFormatterShortStyle = 1,
 | 
			
		||||
    NSDateIntervalFormatterMediumStyle = 2,
 | 
			
		||||
    NSDateIntervalFormatterLongStyle = 3,
 | 
			
		||||
    NSDateIntervalFormatterFullStyle = 4
 | 
			
		||||
} API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// NSDateIntervalFormatter is used to format the range between two NSDates in a locale-sensitive way.
 | 
			
		||||
// NSDateIntervalFormatter returns nil and NO for all methods in NSFormatter.
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSDateIntervalFormatter : NSFormatter
 | 
			
		||||
{
 | 
			
		||||
@private
 | 
			
		||||
    NSLocale *_locale;
 | 
			
		||||
    NSCalendar *_calendar;
 | 
			
		||||
    NSTimeZone *_timeZone;
 | 
			
		||||
    NSString *_dateTemplate;
 | 
			
		||||
    NSString *_dateTemplateFromStyles;
 | 
			
		||||
    void *_formatter;
 | 
			
		||||
    NSDateIntervalFormatterStyle _dateStyle;
 | 
			
		||||
    NSDateIntervalFormatterStyle _timeStyle;
 | 
			
		||||
    BOOL _modified;
 | 
			
		||||
    BOOL _useTemplate;
 | 
			
		||||
    dispatch_semaphore_t _lock;
 | 
			
		||||
    void *_reserved[4];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (null_resettable, copy) NSLocale   *locale;                // default is [NSLocale currentLocale]
 | 
			
		||||
@property (null_resettable, copy) NSCalendar *calendar;              // default is the calendar of the locale
 | 
			
		||||
@property (null_resettable, copy) NSTimeZone *timeZone;              // default is [NSTimeZone defaultTimeZone]
 | 
			
		||||
@property (null_resettable, copy) NSString   *dateTemplate;          // default is an empty string
 | 
			
		||||
@property NSDateIntervalFormatterStyle dateStyle;   // default is NSDateIntervalFormatterNoStyle
 | 
			
		||||
@property NSDateIntervalFormatterStyle timeStyle;   // default is NSDateIntervalFormatterNoStyle
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
     If the range smaller than the resolution specified by the dateTemplate, a single date format will be produced. If the range is larger than the format specified by the dateTemplate, a locale-specific fallback will be used to format the items missing from the pattern.
 | 
			
		||||
     
 | 
			
		||||
     For example, if the range is 2010-03-04 07:56 - 2010-03-04 19:56 (12 hours)
 | 
			
		||||
     - The pattern jm will produce
 | 
			
		||||
        for en_US, "7:56 AM - 7:56 PM"
 | 
			
		||||
        for en_GB, "7:56 - 19:56"
 | 
			
		||||
     - The pattern MMMd will produce
 | 
			
		||||
        for en_US, "Mar 4"
 | 
			
		||||
        for en_GB, "4 Mar"
 | 
			
		||||
     If the range is 2010-03-04 07:56 - 2010-03-08 16:11 (4 days, 8 hours, 15 minutes)
 | 
			
		||||
     - The pattern jm will produce
 | 
			
		||||
        for en_US, "3/4/2010 7:56 AM - 3/8/2010 4:11 PM"
 | 
			
		||||
        for en_GB, "4/3/2010 7:56 - 8/3/2010 16:11"
 | 
			
		||||
     - The pattern MMMd will produce
 | 
			
		||||
        for en_US, "Mar 4-8"
 | 
			
		||||
        for en_GB, "4-8 Mar"
 | 
			
		||||
*/
 | 
			
		||||
- (NSString *)stringFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate;
 | 
			
		||||
 | 
			
		||||
- (nullable NSString *)stringFromDateInterval:(NSDateInterval *)dateInterval API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,179 @@
 | 
			
		||||
/*	NSDebug.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/**************************************************************************
 | 
			
		||||
WARNING: Unsupported API.
 | 
			
		||||
 | 
			
		||||
This module contains material that is only partially supported -- if
 | 
			
		||||
at all.  Do not depend on the existance of any of these symbols in your
 | 
			
		||||
code in future releases of this software.  Certainly, do not depend on
 | 
			
		||||
the symbols in this header in production code.  The format of any data
 | 
			
		||||
produced by the functions in this header may also change at any time.
 | 
			
		||||
 | 
			
		||||
However, it should be noted that the features (but not necessarily the
 | 
			
		||||
exact implementation) in this file have been found to be generally useful,
 | 
			
		||||
and in some cases invaluable, and are not likely to go away anytime soon.
 | 
			
		||||
**************************************************************************/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSAutoreleasePool.h>
 | 
			
		||||
 | 
			
		||||
/* The environment component of this API
 | 
			
		||||
 | 
			
		||||
The boolean- and integer-valued variables declared in this header,
 | 
			
		||||
plus some values set by methods, read starting values from the
 | 
			
		||||
process's environment at process startup.  This is mostly a benefit
 | 
			
		||||
if you need to initialize these variables to some non-default value
 | 
			
		||||
before your program's main() routine gets control, but it also
 | 
			
		||||
allows you to change the value without modifying your program's
 | 
			
		||||
source.
 | 
			
		||||
 | 
			
		||||
The initialization from the environment happens very early, but may
 | 
			
		||||
not have happened yet at the time of a +load method statically linked
 | 
			
		||||
into an application (as opposed to one in a dynamically loaded module). 
 | 
			
		||||
But as noted in the "Foundation Release Notes", +load methods that are
 | 
			
		||||
statically linked into an application are tricky to use and are not
 | 
			
		||||
recommended.
 | 
			
		||||
 | 
			
		||||
Here is a table of the variables/values initialized from the environment
 | 
			
		||||
at startup.  Some of these just set variables, others call methods to
 | 
			
		||||
set the values.
 | 
			
		||||
 | 
			
		||||
NAME OF ENV. VARIABLE		       DEFAULT	SET TO...
 | 
			
		||||
NSDebugEnabled				  NO	"YES"
 | 
			
		||||
NSZombieEnabled				  NO	"YES"
 | 
			
		||||
NSDeallocateZombies			  NO	"YES"
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/****************	General		****************/
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSDebugEnabled;
 | 
			
		||||
	// General-purpose global boolean. Applications and frameworks
 | 
			
		||||
	// may choose to do some extra checking, or use different
 | 
			
		||||
	// algorithms, or log informational messages, or whatever, if
 | 
			
		||||
	// this variable is true (ex: if (NSDebugEnabled) { ... }).
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSZombieEnabled;
 | 
			
		||||
	// Enable object zombies. When an object is deallocated, its isa
 | 
			
		||||
	// pointer is modified to be that of a "zombie" class (whether or
 | 
			
		||||
	// not the storage is then freed can be controlled by the
 | 
			
		||||
	// NSDeallocateZombies variable). Messages sent to the zombie
 | 
			
		||||
	// object cause logged messages and can be broken on in a debugger.
 | 
			
		||||
	// The default is NO.  Note that changing this variable's value
 | 
			
		||||
	// has no effect.
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSDeallocateZombies;
 | 
			
		||||
	// Determines whether the storage of objects that have been
 | 
			
		||||
	// "zombified" is then freed or not. The default value (NO)
 | 
			
		||||
	// is most suitable for debugging messages sent to zombie
 | 
			
		||||
	// objects. And since the memory is never freed, storage
 | 
			
		||||
	// allocated to an object will never be reused, either (which
 | 
			
		||||
	// is sometimes useful otherwise).  Note that changing this
 | 
			
		||||
	// variable's value has no effect.
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSIsFreedObject(id anObject);
 | 
			
		||||
	// Returns YES if the value passed as the parameter is a pointer
 | 
			
		||||
	// to a freed object. Note that memory allocation packages will
 | 
			
		||||
	// eventually reuse freed memory blocks to satisfy a request.
 | 
			
		||||
	// NSZombieEnabled and NSDeallocateZombies can be used to prevent
 | 
			
		||||
	// reuse of allocated objects.
 | 
			
		||||
 | 
			
		||||
/****************	Stack processing	****************/
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT void *NSFrameAddress(NSUInteger frame);
 | 
			
		||||
FOUNDATION_EXPORT void *NSReturnAddress(NSUInteger frame);
 | 
			
		||||
	// Returns the value of the frame pointer or return address,
 | 
			
		||||
	// respectively, of the specified frame. Frames are numbered
 | 
			
		||||
	// sequentially, with the "current" frame being zero, the
 | 
			
		||||
	// previous frame being 1, etc. The current frame is the
 | 
			
		||||
	// frame in which either of these functions is called. For
 | 
			
		||||
	// example, NSReturnAddress(0) returns an address near where
 | 
			
		||||
	// this function was called, NSReturnAddress(1) returns the
 | 
			
		||||
	// address to which control will return when current frame
 | 
			
		||||
	// exits, etc. If the requested frame does not exist, then
 | 
			
		||||
	// NULL is returned. The behavior of these functions is
 | 
			
		||||
	// undefined in the presence of code which has been compiled
 | 
			
		||||
	// without frame pointers.
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSUInteger NSCountFrames(void);
 | 
			
		||||
	// Returns the number of call frames on the stack. The behavior
 | 
			
		||||
	// of this functions is undefined in the presence of code which
 | 
			
		||||
	// has been compiled without frame pointers.
 | 
			
		||||
 | 
			
		||||
/****************	Autorelease pool debugging	****************/
 | 
			
		||||
 | 
			
		||||
// Functions used as interesting breakpoints in a debugger
 | 
			
		||||
// void __NSAutoreleaseNoPool(void *object);
 | 
			
		||||
	// Called to log the "Object X of class Y autoreleased with no
 | 
			
		||||
	// pool in place - just leaking" message.  If an environment
 | 
			
		||||
	// variable named "NSAutoreleaseHaltOnNoPool" is set with string
 | 
			
		||||
	// value "YES", the function will automatically break in the
 | 
			
		||||
	// debugger (or terminate the process).
 | 
			
		||||
 | 
			
		||||
// void __NSAutoreleaseFreedObject(void *freedObject);
 | 
			
		||||
	// Called when a previously freed object would be released
 | 
			
		||||
	// by an autorelease pool.  If an environment variable named
 | 
			
		||||
	// "NSAutoreleaseHaltOnFreedObject" is set with string value
 | 
			
		||||
	// "YES", the function will automatically break in the debugger
 | 
			
		||||
	// (or terminate the process).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSAutoreleasePool (NSAutoreleasePoolDebugging)
 | 
			
		||||
 | 
			
		||||
+ (void)showPools;
 | 
			
		||||
	// Displays to stderr the state of the current thread's
 | 
			
		||||
	// autorelease pool stack.
 | 
			
		||||
 | 
			
		||||
/* DTrace static probes for autorelease pool performance analysis and debugging
 | 
			
		||||
    provider Cocoa_Autorelease {
 | 
			
		||||
       probe pool_push(unsigned long value);		// arg is a token representing pool
 | 
			
		||||
       probe pool_pop_start(unsigned long value);	// arg is a token representing pool
 | 
			
		||||
       probe pool_pop_end(unsigned long value);		// arg is a token representing pool
 | 
			
		||||
       probe autorelease(unsigned long value);		// arg is object pointer
 | 
			
		||||
       probe error_no_pool(unsigned long value);	// arg is object pointer
 | 
			
		||||
       probe error_freed_object(unsigned long value);	// arg is object pointer
 | 
			
		||||
    };
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/****************	Allocation statistics	****************/
 | 
			
		||||
 | 
			
		||||
// The statistics-keeping facilities generate output on various types of
 | 
			
		||||
// events. Currently, output logs can be generated for use of the zone
 | 
			
		||||
// allocation functions (NSZoneMalloc(), etc.), and allocation and
 | 
			
		||||
// deallocation of objects (and other types of lifetime-related events).
 | 
			
		||||
 | 
			
		||||
// This boolean is obsolete and unused; don't use this.
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSKeepAllocationStatistics;
 | 
			
		||||
 | 
			
		||||
// Object allocation event types
 | 
			
		||||
#define NSObjectAutoreleasedEvent		3
 | 
			
		||||
#define NSObjectExtraRefIncrementedEvent	4
 | 
			
		||||
#define NSObjectExtraRefDecrementedEvent	5
 | 
			
		||||
#define NSObjectInternalRefIncrementedEvent	6
 | 
			
		||||
#define NSObjectInternalRefDecrementedEvent	7
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT void NSRecordAllocationEvent(int eventType, id object);
 | 
			
		||||
	// Notes an object or zone allocation event and various other
 | 
			
		||||
	// statistics, such as the time and current thread.
 | 
			
		||||
	// The behavior is undefined (and likely catastrophic) if
 | 
			
		||||
	// the correct arguments for 'eventType' are not provided.
 | 
			
		||||
	//
 | 
			
		||||
	// The parameter prototypes for each event type are shown below.
 | 
			
		||||
	//   NSRecordAllocationEvent(NSObjectAutoreleasedEvent, curObj)
 | 
			
		||||
	//   NSRecordAllocationEvent(NSObjectExtraRefIncrementedEvent, curObj)
 | 
			
		||||
	//   NSRecordAllocationEvent(NSObjectExtraRefDecrementedEvent, curObj)
 | 
			
		||||
	//   NSRecordAllocationEvent(NSObjectInternalRefIncrementedEvent, curObj)
 | 
			
		||||
	//   NSRecordAllocationEvent(NSObjectInternalRefDecrementedEvent, curObj)
 | 
			
		||||
	//
 | 
			
		||||
	// Only the Foundation should have reason to use many of these.
 | 
			
		||||
	// The only common use of this function should be with these two events:
 | 
			
		||||
	//	NSObjectInternalRefIncrementedEvent
 | 
			
		||||
	//	NSObjectInternalRefDecrementedEvent
 | 
			
		||||
	// when a class overrides -retain and -release to do its own
 | 
			
		||||
	// reference counting.
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,89 @@
 | 
			
		||||
/*	NSDecimal.h
 | 
			
		||||
	Copyright (c) 1995-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
 | 
			
		||||
@class NSDictionary;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/***************	Type definitions		***********/
 | 
			
		||||
 | 
			
		||||
// Rounding policies :
 | 
			
		||||
// Original
 | 
			
		||||
//    value 1.2  1.21  1.25  1.35  1.27
 | 
			
		||||
// Plain    1.2  1.2   1.3   1.4   1.3
 | 
			
		||||
// Down     1.2  1.2   1.2   1.3   1.2
 | 
			
		||||
// Up       1.2  1.3   1.3   1.4   1.3
 | 
			
		||||
// Bankers  1.2  1.2   1.2   1.4   1.3
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSRoundingMode) {
 | 
			
		||||
    NSRoundPlain,   // Round up on a tie
 | 
			
		||||
    NSRoundDown,    // Always down == truncate
 | 
			
		||||
    NSRoundUp,      // Always up
 | 
			
		||||
    NSRoundBankers  // on a tie round so last digit is even
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSCalculationError) {
 | 
			
		||||
    NSCalculationNoError = 0,
 | 
			
		||||
    NSCalculationLossOfPrecision, // Result lost precision
 | 
			
		||||
    NSCalculationUnderflow,       // Result became 0
 | 
			
		||||
    NSCalculationOverflow,        // Result exceeds possible representation
 | 
			
		||||
    NSCalculationDivideByZero
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define NSDecimalMaxSize (8)
 | 
			
		||||
    // Give a precision of at least 38 decimal digits, 128 binary positions.
 | 
			
		||||
 | 
			
		||||
#define NSDecimalNoScale SHRT_MAX
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    signed   int _exponent:8;
 | 
			
		||||
    unsigned int _length:4;     // length == 0 && isNegative -> NaN
 | 
			
		||||
    unsigned int _isNegative:1;
 | 
			
		||||
    unsigned int _isCompact:1;
 | 
			
		||||
    unsigned int _reserved:18;
 | 
			
		||||
    unsigned short _mantissa[NSDecimalMaxSize];
 | 
			
		||||
} NSDecimal;
 | 
			
		||||
 | 
			
		||||
NS_INLINE BOOL NSDecimalIsNotANumber(const NSDecimal *dcm)
 | 
			
		||||
  { return ((dcm->_length == 0) && dcm->_isNegative); }
 | 
			
		||||
 | 
			
		||||
/***************	Operations		***********/
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT void NSDecimalCopy(NSDecimal *destination, const NSDecimal *source);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT void NSDecimalCompact(NSDecimal *number);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSComparisonResult NSDecimalCompare(const NSDecimal *leftOperand, const NSDecimal *rightOperand);
 | 
			
		||||
    // NSDecimalCompare:Compares leftOperand and rightOperand.
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT void NSDecimalRound(NSDecimal *result, const NSDecimal *number, NSInteger scale, NSRoundingMode roundingMode);
 | 
			
		||||
    // Rounds num to the given scale using the given mode.
 | 
			
		||||
    // result may be a pointer to same space as num.
 | 
			
		||||
    // scale indicates number of significant digits after the decimal point
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSCalculationError NSDecimalNormalize(NSDecimal *number1, NSDecimal *number2, NSRoundingMode roundingMode);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSCalculationError NSDecimalAdd(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode);
 | 
			
		||||
    // Exact operations. result may be a pointer to same space as leftOperand or rightOperand
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSCalculationError NSDecimalSubtract(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode);
 | 
			
		||||
    // Exact operations. result may be a pointer to same space as leftOperand or rightOperand
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSCalculationError NSDecimalMultiply(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode);
 | 
			
		||||
    // Exact operations. result may be a pointer to same space as leftOperand or rightOperand
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSCalculationError NSDecimalDivide(NSDecimal *result, const NSDecimal *leftOperand, const NSDecimal *rightOperand, NSRoundingMode roundingMode);
 | 
			
		||||
    // Division could be silently inexact;
 | 
			
		||||
    // Exact operations. result may be a pointer to same space as leftOperand or rightOperand
 | 
			
		||||
    
 | 
			
		||||
FOUNDATION_EXPORT NSCalculationError NSDecimalPower(NSDecimal *result, const NSDecimal *number, NSUInteger power, NSRoundingMode roundingMode);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSCalculationError NSDecimalMultiplyByPowerOf10(NSDecimal *result, const NSDecimal *number, short power, NSRoundingMode roundingMode);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSDecimalString(const NSDecimal *dcm, id _Nullable locale);
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,156 @@
 | 
			
		||||
/*	NSDecimalNumber.h
 | 
			
		||||
	Copyright (c) 1995-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSValue.h>
 | 
			
		||||
#import <Foundation/NSScanner.h>
 | 
			
		||||
#import <Foundation/NSDecimal.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSException.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/***************	Exceptions		***********/
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSDecimalNumberExactnessException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSDecimalNumberOverflowException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSDecimalNumberUnderflowException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSDecimalNumberDivideByZeroException;
 | 
			
		||||
 | 
			
		||||
/***************	Rounding and Exception behavior		***********/
 | 
			
		||||
 | 
			
		||||
@class NSDecimalNumber;
 | 
			
		||||
 | 
			
		||||
@protocol NSDecimalNumberBehaviors
 | 
			
		||||
 | 
			
		||||
- (NSRoundingMode)roundingMode;
 | 
			
		||||
 | 
			
		||||
- (short)scale;
 | 
			
		||||
    // The scale could return NO_SCALE for no defined scale.
 | 
			
		||||
 | 
			
		||||
- (nullable NSDecimalNumber *)exceptionDuringOperation:(SEL)operation error:(NSCalculationError)error leftOperand:(NSDecimalNumber *)leftOperand rightOperand:(nullable NSDecimalNumber *)rightOperand;
 | 
			
		||||
    // Receiver can raise, return a new value, or return nil to ignore the exception.
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/***************	NSDecimalNumber: the class		***********/
 | 
			
		||||
 | 
			
		||||
@interface NSDecimalNumber : NSNumber {
 | 
			
		||||
@private
 | 
			
		||||
    signed   int _exponent:8;
 | 
			
		||||
    unsigned int _length:4;
 | 
			
		||||
    unsigned int _isNegative:1;
 | 
			
		||||
    unsigned int _isCompact:1;
 | 
			
		||||
    unsigned int _reserved:1;
 | 
			
		||||
    unsigned int _hasExternalRefCount:1;
 | 
			
		||||
    unsigned int _refs:16;
 | 
			
		||||
    unsigned short _mantissa[0]; /* GCC */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithMantissa:(unsigned long long)mantissa exponent:(short)exponent isNegative:(BOOL)flag;
 | 
			
		||||
- (instancetype)initWithDecimal:(NSDecimal)dcm NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithString:(nullable NSString *)numberValue;
 | 
			
		||||
- (instancetype)initWithString:(nullable NSString *)numberValue locale:(nullable id)locale;
 | 
			
		||||
 | 
			
		||||
- (NSString *)descriptionWithLocale:(nullable id)locale;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSDecimal decimalValue;
 | 
			
		||||
 | 
			
		||||
+ (NSDecimalNumber *)decimalNumberWithMantissa:(unsigned long long)mantissa exponent:(short)exponent isNegative:(BOOL)flag;
 | 
			
		||||
+ (NSDecimalNumber *)decimalNumberWithDecimal:(NSDecimal)dcm;
 | 
			
		||||
+ (NSDecimalNumber *)decimalNumberWithString:(nullable NSString *)numberValue;
 | 
			
		||||
+ (NSDecimalNumber *)decimalNumberWithString:(nullable NSString *)numberValue locale:(nullable id)locale;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, copy) NSDecimalNumber *zero;
 | 
			
		||||
@property (class, readonly, copy) NSDecimalNumber *one;
 | 
			
		||||
@property (class, readonly, copy) NSDecimalNumber *minimumDecimalNumber;
 | 
			
		||||
@property (class, readonly, copy) NSDecimalNumber *maximumDecimalNumber;
 | 
			
		||||
@property (class, readonly, copy) NSDecimalNumber *notANumber;
 | 
			
		||||
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByAdding:(NSDecimalNumber *)decimalNumber;
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByAdding:(NSDecimalNumber *)decimalNumber withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior;
 | 
			
		||||
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberBySubtracting:(NSDecimalNumber *)decimalNumber;
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberBySubtracting:(NSDecimalNumber *)decimalNumber withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior;
 | 
			
		||||
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByMultiplyingBy:(NSDecimalNumber *)decimalNumber;
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByMultiplyingBy:(NSDecimalNumber *)decimalNumber withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior;
 | 
			
		||||
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByDividingBy:(NSDecimalNumber *)decimalNumber;
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByDividingBy:(NSDecimalNumber *)decimalNumber withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior;
 | 
			
		||||
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByRaisingToPower:(NSUInteger)power;
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByRaisingToPower:(NSUInteger)power withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior;
 | 
			
		||||
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(short)power;
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByMultiplyingByPowerOf10:(short)power withBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (NSDecimalNumber *)decimalNumberByRoundingAccordingToBehavior:(nullable id <NSDecimalNumberBehaviors>)behavior;
 | 
			
		||||
    // Round to the scale of the behavior.
 | 
			
		||||
 | 
			
		||||
- (NSComparisonResult)compare:(NSNumber *)decimalNumber;
 | 
			
		||||
    // compare two NSDecimalNumbers
 | 
			
		||||
 | 
			
		||||
@property (class, strong) id <NSDecimalNumberBehaviors> defaultBehavior;
 | 
			
		||||
    // One behavior per thread - The default behavior is
 | 
			
		||||
    //   rounding mode: NSRoundPlain
 | 
			
		||||
    //   scale: No defined scale (full precision)
 | 
			
		||||
    //   ignore exactnessException
 | 
			
		||||
    //   raise on overflow, underflow and divide by zero.
 | 
			
		||||
 | 
			
		||||
@property (readonly) const char *objCType NS_RETURNS_INNER_POINTER;
 | 
			
		||||
    // return 'd' for double
 | 
			
		||||
    
 | 
			
		||||
@property (readonly) double doubleValue;
 | 
			
		||||
    // return an approximate double value
 | 
			
		||||
    
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/***********	A class for defining common behaviors		*******/
 | 
			
		||||
 | 
			
		||||
@interface NSDecimalNumberHandler : NSObject <NSDecimalNumberBehaviors, NSCoding> {
 | 
			
		||||
  @private
 | 
			
		||||
    signed int _scale:16;
 | 
			
		||||
    unsigned _roundingMode:3;
 | 
			
		||||
    unsigned _raiseOnExactness:1;
 | 
			
		||||
    unsigned _raiseOnOverflow:1;
 | 
			
		||||
    unsigned _raiseOnUnderflow:1;
 | 
			
		||||
    unsigned _raiseOnDivideByZero:1;
 | 
			
		||||
    unsigned _unused:9;
 | 
			
		||||
    void *_reserved2;
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSDecimalNumberHandler *defaultDecimalNumberHandler;
 | 
			
		||||
    // rounding mode: NSRoundPlain
 | 
			
		||||
    // scale: No defined scale (full precision)
 | 
			
		||||
    // ignore exactnessException (return nil)
 | 
			
		||||
    // raise on overflow, underflow and divide by zero.
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithRoundingMode:(NSRoundingMode)roundingMode scale:(short)scale raiseOnExactness:(BOOL)exact raiseOnOverflow:(BOOL)overflow raiseOnUnderflow:(BOOL)underflow raiseOnDivideByZero:(BOOL)divideByZero NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
+ (instancetype)decimalNumberHandlerWithRoundingMode:(NSRoundingMode)roundingMode scale:(short)scale raiseOnExactness:(BOOL)exact raiseOnOverflow:(BOOL)overflow raiseOnUnderflow:(BOOL)underflow raiseOnDivideByZero:(BOOL)divideByZero;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/***********	Extensions to other classes		*******/
 | 
			
		||||
 | 
			
		||||
@interface NSNumber (NSDecimalNumberExtensions)
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSDecimal decimalValue;
 | 
			
		||||
    // Could be silently inexact for float and double.
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSScanner (NSDecimalNumberScanning)
 | 
			
		||||
 | 
			
		||||
- (BOOL)scanDecimal:(nullable NSDecimal *)dcm
 | 
			
		||||
#if defined(__swift__) // Deprecated for Swift only:
 | 
			
		||||
    API_DEPRECATED_WITH_REPLACEMENT("scanDecimal()", macosx(10.0,10.15), ios(2.0,13.0), watchos(2.0,13.0), tvos(9.0,13.0))
 | 
			
		||||
#endif
 | 
			
		||||
    ;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,160 @@
 | 
			
		||||
/*	NSDictionary.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSEnumerator.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>, NSSet<ObjectType>, NSString, NSURL;
 | 
			
		||||
 | 
			
		||||
/****************	Immutable Dictionary	****************/
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSDictionary<__covariant KeyType, __covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger count;
 | 
			
		||||
- (nullable ObjectType)objectForKey:(KeyType)aKey;
 | 
			
		||||
- (NSEnumerator<KeyType> *)keyEnumerator;
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithObjects:(const ObjectType _Nonnull [_Nullable])objects forKeys:(const KeyType <NSCopying> _Nonnull [_Nullable])keys count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDictionary<KeyType, ObjectType> (NSExtendedDictionary)
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<KeyType> *allKeys;
 | 
			
		||||
- (NSArray<KeyType> *)allKeysForObject:(ObjectType)anObject;
 | 
			
		||||
@property (readonly, copy) NSArray<ObjectType> *allValues;
 | 
			
		||||
@property (readonly, copy) NSString *description;
 | 
			
		||||
@property (readonly, copy) NSString *descriptionInStringsFileFormat;
 | 
			
		||||
- (NSString *)descriptionWithLocale:(nullable id)locale;
 | 
			
		||||
- (NSString *)descriptionWithLocale:(nullable id)locale indent:(NSUInteger)level;
 | 
			
		||||
- (BOOL)isEqualToDictionary:(NSDictionary<KeyType, ObjectType> *)otherDictionary;
 | 
			
		||||
- (NSEnumerator<ObjectType> *)objectEnumerator;
 | 
			
		||||
- (NSArray<ObjectType> *)objectsForKeys:(NSArray<KeyType> *)keys notFoundMarker:(ObjectType)marker;
 | 
			
		||||
 | 
			
		||||
/* Serializes this instance to the specified URL in the NSPropertyList format (using NSPropertyListXMLFormat_v1_0). For other formats use NSPropertyListSerialization directly. */
 | 
			
		||||
- (BOOL)writeToURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (NSArray<KeyType> *)keysSortedByValueUsingSelector:(SEL)comparator;
 | 
			
		||||
// count refers to the number of elements in the dictionary
 | 
			
		||||
- (void)getObjects:(ObjectType _Nonnull __unsafe_unretained [_Nullable])objects andKeys:(KeyType _Nonnull __unsafe_unretained [_Nullable])keys count:(NSUInteger)count API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)) NS_SWIFT_UNAVAILABLE("Use 'allKeys' and/or 'allValues' instead");
 | 
			
		||||
 | 
			
		||||
- (nullable ObjectType)objectForKeyedSubscript:(KeyType)key API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (void)enumerateKeysAndObjectsUsingBlock:(void (NS_NOESCAPE ^)(KeyType key, ObjectType obj, BOOL *stop))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)enumerateKeysAndObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(KeyType key, ObjectType obj, BOOL *stop))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (NSArray<KeyType> *)keysSortedByValueUsingComparator:(NSComparator NS_NOESCAPE)cmptr API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSArray<KeyType> *)keysSortedByValueWithOptions:(NSSortOptions)opts usingComparator:(NSComparator NS_NOESCAPE)cmptr API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (NSSet<KeyType> *)keysOfEntriesPassingTest:(BOOL (NS_NOESCAPE ^)(KeyType key, ObjectType obj, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSSet<KeyType> *)keysOfEntriesWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(KeyType key, ObjectType obj, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDictionary<KeyType, ObjectType> (NSDeprecated)
 | 
			
		||||
/// This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:andKeys:count:
 | 
			
		||||
- (void)getObjects:(ObjectType _Nonnull __unsafe_unretained [_Nullable])objects andKeys:(KeyType _Nonnull __unsafe_unretained [_Nullable])keys  NS_SWIFT_UNAVAILABLE("Use 'allKeys' and/or 'allValues' instead")  API_DEPRECATED("Use -getObjects:andKeys:count: instead", macos(10.0, 10.13), ios(2.0, 11.0), watchos(2.0, 4.0), tvos(9.0, 11.0));
 | 
			
		||||
 | 
			
		||||
/* These methods are deprecated, and will be marked with API_DEPRECATED in a subsequent release. Use the variants that use errors instead. */
 | 
			
		||||
+ (nullable NSDictionary<KeyType, ObjectType> *)dictionaryWithContentsOfFile:(NSString *)path API_DEPRECATED_WITH_REPLACEMENT("dictionaryWithContentsOfURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
+ (nullable NSDictionary<KeyType, ObjectType> *)dictionaryWithContentsOfURL:(NSURL *)url API_DEPRECATED_WITH_REPLACEMENT("dictionaryWithContentsOfURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (nullable NSDictionary<KeyType, ObjectType> *)initWithContentsOfFile:(NSString *)path API_DEPRECATED_WITH_REPLACEMENT("initWithContentsOfURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (nullable NSDictionary<KeyType, ObjectType> *)initWithContentsOfURL:(NSURL *)url API_DEPRECATED_WITH_REPLACEMENT("initWithContentsOfURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile API_DEPRECATED_WITH_REPLACEMENT("writeToURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (BOOL)writeToURL:(NSURL *)url atomically:(BOOL)atomically API_DEPRECATED_WITH_REPLACEMENT("writeToURL:error:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED)); // the atomically flag is ignored if url of a type that cannot be written atomically.
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDictionary<KeyType, ObjectType> (NSDictionaryCreation)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)dictionary;
 | 
			
		||||
+ (instancetype)dictionaryWithObject:(ObjectType)object forKey:(KeyType <NSCopying>)key;
 | 
			
		||||
+ (instancetype)dictionaryWithObjects:(const ObjectType _Nonnull [_Nullable])objects forKeys:(const KeyType <NSCopying> _Nonnull [_Nullable])keys count:(NSUInteger)cnt;
 | 
			
		||||
 | 
			
		||||
+ (instancetype)dictionaryWithObjectsAndKeys:(id)firstObject, ... NS_REQUIRES_NIL_TERMINATION NS_SWIFT_UNAVAILABLE("Use dictionary literals instead");
 | 
			
		||||
 | 
			
		||||
+ (instancetype)dictionaryWithDictionary:(NSDictionary<KeyType, ObjectType> *)dict;
 | 
			
		||||
+ (instancetype)dictionaryWithObjects:(NSArray<ObjectType> *)objects forKeys:(NSArray<KeyType <NSCopying>> *)keys;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithObjectsAndKeys:(id)firstObject, ... NS_REQUIRES_NIL_TERMINATION;
 | 
			
		||||
- (instancetype)initWithDictionary:(NSDictionary<KeyType, ObjectType> *)otherDictionary;
 | 
			
		||||
- (instancetype)initWithDictionary:(NSDictionary<KeyType, ObjectType> *)otherDictionary copyItems:(BOOL)flag;
 | 
			
		||||
- (instancetype)initWithObjects:(NSArray<ObjectType> *)objects forKeys:(NSArray<KeyType <NSCopying>> *)keys;
 | 
			
		||||
 | 
			
		||||
/* Reads dictionary stored in NSPropertyList format from the specified url. */
 | 
			
		||||
- (nullable NSDictionary<NSString *, ObjectType> *)initWithContentsOfURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
/* Reads dictionary stored in NSPropertyList format from the specified url. */
 | 
			
		||||
+ (nullable NSDictionary<NSString *, ObjectType> *)dictionaryWithContentsOfURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0)) NS_SWIFT_UNAVAILABLE("Use initializer instead");
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/****************	Mutable Dictionary	****************/
 | 
			
		||||
 | 
			
		||||
@interface NSMutableDictionary<KeyType, ObjectType> : NSDictionary<KeyType, ObjectType>
 | 
			
		||||
 | 
			
		||||
- (void)removeObjectForKey:(KeyType)aKey;
 | 
			
		||||
- (void)setObject:(ObjectType)anObject forKey:(KeyType <NSCopying>)aKey;
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithCapacity:(NSUInteger)numItems NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableDictionary<KeyType, ObjectType> (NSExtendedMutableDictionary)
 | 
			
		||||
 | 
			
		||||
- (void)addEntriesFromDictionary:(NSDictionary<KeyType, ObjectType> *)otherDictionary;
 | 
			
		||||
- (void)removeAllObjects;
 | 
			
		||||
- (void)removeObjectsForKeys:(NSArray<KeyType> *)keyArray;
 | 
			
		||||
- (void)setDictionary:(NSDictionary<KeyType, ObjectType> *)otherDictionary;
 | 
			
		||||
- (void)setObject:(nullable ObjectType)obj forKeyedSubscript:(KeyType <NSCopying>)key API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableDictionary<KeyType, ObjectType> (NSMutableDictionaryCreation)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems;
 | 
			
		||||
 | 
			
		||||
+ (nullable NSMutableDictionary<KeyType, ObjectType> *)dictionaryWithContentsOfFile:(NSString *)path;
 | 
			
		||||
+ (nullable NSMutableDictionary<KeyType, ObjectType> *)dictionaryWithContentsOfURL:(NSURL *)url;
 | 
			
		||||
- (nullable NSMutableDictionary<KeyType, ObjectType> *)initWithContentsOfFile:(NSString *)path;
 | 
			
		||||
- (nullable NSMutableDictionary<KeyType, ObjectType> *)initWithContentsOfURL:(NSURL *)url;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDictionary<KeyType, ObjectType> (NSSharedKeySetDictionary)
 | 
			
		||||
 | 
			
		||||
/*  Use this method to create a key set to pass to +dictionaryWithSharedKeySet:.
 | 
			
		||||
 The keys are copied from the array and must be copyable.
 | 
			
		||||
 If the array parameter is nil or not an NSArray, an exception is thrown.
 | 
			
		||||
 If the array of keys is empty, an empty key set is returned.
 | 
			
		||||
 The array of keys may contain duplicates, which are ignored (it is undefined which object of each duplicate pair is used).
 | 
			
		||||
 As for any usage of hashing, is recommended that the keys have a well-distributed implementation of -hash, and the hash codes must satisfy the hash/isEqual: invariant.
 | 
			
		||||
 Keys with duplicate hash codes are allowed, but will cause lower performance and increase memory usage.
 | 
			
		||||
 */
 | 
			
		||||
+ (id)sharedKeySetForKeys:(NSArray<KeyType <NSCopying>> *)keys API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableDictionary<KeyType, ObjectType> (NSSharedKeySetDictionary)
 | 
			
		||||
 | 
			
		||||
/*  Create a mutable dictionary which is optimized for dealing with a known set of keys.
 | 
			
		||||
 Keys that are not in the key set can still be set into the dictionary, but that usage is not optimal.
 | 
			
		||||
 As with any dictionary, the keys must be copyable.
 | 
			
		||||
 If keyset is nil, an exception is thrown.
 | 
			
		||||
 If keyset is not an object returned by +sharedKeySetForKeys:, an exception is thrown.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSMutableDictionary<KeyType, ObjectType> *)dictionaryWithSharedKeySet:(id)keyset API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDictionary<K, V> (NSGenericFastEnumeraiton) <NSFastEnumeration>
 | 
			
		||||
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(K __unsafe_unretained _Nullable [_Nonnull])buffer count:(NSUInteger)len;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,41 @@
 | 
			
		||||
/*	NSDistantObject.h
 | 
			
		||||
	Copyright (c) 1989-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSProxy.h>
 | 
			
		||||
 | 
			
		||||
@class Protocol, NSConnection, NSCoder;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use NSXPCConnection instead", macosx(10.0, 10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0))
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("Use NSXPCConnection instead")
 | 
			
		||||
@interface NSDistantObject : NSProxy <NSCoding> {
 | 
			
		||||
    @private
 | 
			
		||||
    id         _knownSelectors;
 | 
			
		||||
    NSUInteger _wireCount;
 | 
			
		||||
    NSUInteger _refCount;
 | 
			
		||||
    id         _proto;
 | 
			
		||||
    uint16_t   ___2;
 | 
			
		||||
    uint8_t    ___1;
 | 
			
		||||
    uint8_t    _wireType;
 | 
			
		||||
    id         _remoteClass;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Do not attempt to subclass NSDistantObject -- it is futile
 | 
			
		||||
// Do not use these next two methods
 | 
			
		||||
+ (nullable id)proxyWithTarget:(id)target connection:(NSConnection *)connection;
 | 
			
		||||
- (nullable instancetype)initWithTarget:(id)target connection:(NSConnection *)connection;
 | 
			
		||||
 | 
			
		||||
+ (id)proxyWithLocal:(id)target connection:(NSConnection *)connection;
 | 
			
		||||
- (instancetype)initWithLocal:(id)target connection:(NSConnection *)connection;
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)inCoder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (void)setProtocolForProxy:(nullable Protocol *)proto;
 | 
			
		||||
 | 
			
		||||
@property (readonly, retain) NSConnection *connectionForProxy;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,28 @@
 | 
			
		||||
/*	NSDistributedLock.h
 | 
			
		||||
	Copyright (c) 1995-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSDate;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSDistributedLock : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    void *_priv;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
+ (nullable NSDistributedLock *)lockWithPath:(NSString *)path;  
 | 
			
		||||
 | 
			
		||||
- (instancetype)init API_UNAVAILABLE(macos, ios, watchos, tvos);
 | 
			
		||||
- (nullable instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (BOOL)tryLock;
 | 
			
		||||
- (void)unlock;
 | 
			
		||||
- (void)breakLock;
 | 
			
		||||
@property (readonly, copy) NSDate *lockDate;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,69 @@
 | 
			
		||||
/*	NSDistributedNotificationCenter.h
 | 
			
		||||
	Copyright (c) 1996-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSDictionary;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSDistributedNotificationCenterType NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSDistributedNotificationCenterType const NSLocalNotificationCenterType;
 | 
			
		||||
// Distributes notifications to all tasks on the sender's machine.
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSNotificationSuspensionBehavior) {
 | 
			
		||||
    NSNotificationSuspensionBehaviorDrop = 1,
 | 
			
		||||
    // The server will not queue any notifications with this name and object until setSuspended:NO is called.
 | 
			
		||||
    NSNotificationSuspensionBehaviorCoalesce = 2,
 | 
			
		||||
    // The server will only queue the last notification of the specified name and object; earlier notifications are dropped.  In cover methods for which suspension behavior is not an explicit argument, NSNotificationSuspensionBehaviorCoalesce is the default.
 | 
			
		||||
    NSNotificationSuspensionBehaviorHold = 3,
 | 
			
		||||
    // The server will hold all matching notifications until the queue has been filled (queue size determined by the server) at which point the server may flush queued notifications.
 | 
			
		||||
    NSNotificationSuspensionBehaviorDeliverImmediately = 4
 | 
			
		||||
    // The server will deliver notifications matching this registration irrespective of whether setSuspended:YES has been called.  When a notification with this suspension behavior is matched, it has the effect of first flushing
 | 
			
		||||
    // any queued notifications.  The effect is somewhat as if setSuspended:NO were first called if the app is suspended, followed by
 | 
			
		||||
    // the notification in question being delivered, followed by a transition back to the previous suspended or unsuspended state.
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDistributedNotificationOptions) {
 | 
			
		||||
    NSDistributedNotificationDeliverImmediately = (1UL << 0),
 | 
			
		||||
    NSDistributedNotificationPostToAllSessions = (1UL << 1)
 | 
			
		||||
};
 | 
			
		||||
static const NSDistributedNotificationOptions NSNotificationDeliverImmediately = NSDistributedNotificationDeliverImmediately;
 | 
			
		||||
static const NSDistributedNotificationOptions NSNotificationPostToAllSessions = NSDistributedNotificationPostToAllSessions;
 | 
			
		||||
 | 
			
		||||
@interface NSDistributedNotificationCenter : NSNotificationCenter
 | 
			
		||||
 | 
			
		||||
+ (NSDistributedNotificationCenter *)notificationCenterForType:(NSDistributedNotificationCenterType)notificationCenterType;
 | 
			
		||||
// Currently there is only one type.
 | 
			
		||||
 | 
			
		||||
+ (NSDistributedNotificationCenter *)defaultCenter;
 | 
			
		||||
// Returns the default distributed notification center - cover for [NSDistributedNotificationCenter notificationCenterForType:NSLocalNotificationCenterType]
 | 
			
		||||
 | 
			
		||||
- (void)addObserver:(id)observer selector:(SEL)selector name:(nullable NSNotificationName)name object:(nullable NSString *)object suspensionBehavior:(NSNotificationSuspensionBehavior)suspensionBehavior;
 | 
			
		||||
// All other registration methods are covers of this one, with the default for suspensionBehavior = NSNotificationSuspensionBehaviorCoalesce.
 | 
			
		||||
 | 
			
		||||
- (void)postNotificationName:(NSNotificationName)name object:(nullable NSString *)object userInfo:(nullable NSDictionary *)userInfo deliverImmediately:(BOOL)deliverImmediately;
 | 
			
		||||
// All other posting methods are covers of this one.  The deliverImmediately argument causes the notification to be received in the same manner as if matching registrants had registered with suspension
 | 
			
		||||
// behavior NSNotificationSuspensionBehaviorDeliverImmediately.  The default in covers is deliverImmediately = NO (respect suspension behavior of registrants).
 | 
			
		||||
 | 
			
		||||
- (void)postNotificationName:(NSNotificationName)name object:(nullable NSString *)object userInfo:(nullable NSDictionary *)userInfo options:(NSDistributedNotificationOptions)options;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Called with suspended = YES, enables the variety of suspension behaviors enumerated above.  Called with suspended = NO disables them (immediate delivery of notifications is resumed).
 | 
			
		||||
@property BOOL suspended;
 | 
			
		||||
 | 
			
		||||
// Methods from NSNotificationCenter that are re-declared in part because the anObject argument is typed to be an NSString.
 | 
			
		||||
- (void)addObserver:(id)observer selector:(SEL)aSelector name:(nullable NSNotificationName)aName object:(nullable NSString *)anObject;
 | 
			
		||||
 | 
			
		||||
- (void)postNotificationName:(NSNotificationName)aName object:(nullable NSString *)anObject;
 | 
			
		||||
- (void)postNotificationName:(NSNotificationName)aName object:(nullable NSString *)anObject userInfo:(nullable NSDictionary *)aUserInfo;
 | 
			
		||||
- (void)removeObserver:(id)observer name:(nullable NSNotificationName)aName object:(nullable NSString *)anObject;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,43 @@
 | 
			
		||||
/*      NSEnergyFormatter.h
 | 
			
		||||
        Copyright (c) 2014-2019, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSEnergyFormatterUnit) {
 | 
			
		||||
    NSEnergyFormatterUnitJoule = 11,
 | 
			
		||||
    NSEnergyFormatterUnitKilojoule = 14,
 | 
			
		||||
    NSEnergyFormatterUnitCalorie = (7 << 8) + 1,       // chemistry "calories", abbr "cal"
 | 
			
		||||
    NSEnergyFormatterUnitKilocalorie = (7 << 8) + 2,   // kilocalories in general, abbr “kcal”, or “C” in some locales (e.g. US) when usesFoodEnergy is set to YES
 | 
			
		||||
} API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSEnergyFormatter : NSFormatter {
 | 
			
		||||
@private
 | 
			
		||||
    void *_formatter;
 | 
			
		||||
    BOOL _isForFoodEnergyUse;
 | 
			
		||||
    void *_reserved[2];
 | 
			
		||||
}
 | 
			
		||||
@property (null_resettable, copy) NSNumberFormatter *numberFormatter;    // default is NSNumberFormatter with NSNumberFormatterDecimalStyle
 | 
			
		||||
@property NSFormattingUnitStyle unitStyle;              // default is NSFormattingUnitStyleMedium
 | 
			
		||||
@property (getter = isForFoodEnergyUse) BOOL forFoodEnergyUse; // default is NO; if it is set to YES, NSEnergyFormatterUnitKilocalorie may be “C” instead of “kcal"
 | 
			
		||||
 | 
			
		||||
// Format a combination of a number and an unit to a localized string.
 | 
			
		||||
- (NSString *)stringFromValue:(double)value unit:(NSEnergyFormatterUnit)unit;
 | 
			
		||||
 | 
			
		||||
// Format a number in joules to a localized string with the locale-appropriate unit and an appropriate scale (e.g. 10.3J = 2.46cal in the US locale).
 | 
			
		||||
- (NSString *)stringFromJoules:(double)numberInJoules;
 | 
			
		||||
 | 
			
		||||
// Return a localized string of the given unit, and if the unit is singular or plural is based on the given number.
 | 
			
		||||
- (NSString *)unitStringFromValue:(double)value unit:(NSEnergyFormatterUnit)unit;
 | 
			
		||||
 | 
			
		||||
// Return the locale-appropriate unit, the same unit used by -stringFromJoules:.
 | 
			
		||||
- (NSString *)unitStringFromJoules:(double)numberInJoules usedUnit:(nullable NSEnergyFormatterUnit *)unitp;
 | 
			
		||||
 | 
			
		||||
// No parsing is supported. This method will return NO.
 | 
			
		||||
- (BOOL)getObjectValue:(out id _Nullable * _Nullable)obj forString:(NSString *)string errorDescription:(out NSString * _Nullable * _Nullable)error;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,46 @@
 | 
			
		||||
/*	NSEnumerator.h
 | 
			
		||||
	Copyright (c) 1995-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The fast enumeration protocol NSFastEnumeration is adopted and
 | 
			
		||||
 * implemented by objects wishing to make use of a fast and safe
 | 
			
		||||
 * enumeration style.  The language "foreach" construct then can
 | 
			
		||||
 * be used with such objects.
 | 
			
		||||
 *
 | 
			
		||||
 * The abstract class NSEnumerator itself is taught how to do this
 | 
			
		||||
 * for convenience by using -nextObject to return items one at a time.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    unsigned long state;
 | 
			
		||||
    id __unsafe_unretained _Nullable * _Nullable itemsPtr;
 | 
			
		||||
    unsigned long * _Nullable mutationsPtr;
 | 
			
		||||
    unsigned long extra[5];
 | 
			
		||||
} NSFastEnumerationState;
 | 
			
		||||
 | 
			
		||||
@protocol NSFastEnumeration
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained _Nullable [_Nonnull])buffer count:(NSUInteger)len;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
 | 
			
		||||
 | 
			
		||||
- (nullable ObjectType)nextObject;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<ObjectType> *allObjects;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,133 @@
 | 
			
		||||
/*	NSError.h
 | 
			
		||||
	Copyright (c) 2003-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSDictionary<KeyType, ObjectType>, NSArray<ObjectType>, NSString;
 | 
			
		||||
 | 
			
		||||
typedef NSString *NSErrorDomain;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
// Predefined domain for errors from most AppKit and Foundation APIs.
 | 
			
		||||
FOUNDATION_EXPORT NSErrorDomain const NSCocoaErrorDomain;
 | 
			
		||||
 | 
			
		||||
// Other predefined domains; value of "code" will correspond to preexisting values in these domains.
 | 
			
		||||
FOUNDATION_EXPORT NSErrorDomain const NSPOSIXErrorDomain;
 | 
			
		||||
FOUNDATION_EXPORT NSErrorDomain const NSOSStatusErrorDomain;
 | 
			
		||||
FOUNDATION_EXPORT NSErrorDomain const NSMachErrorDomain;
 | 
			
		||||
 | 
			
		||||
typedef NSString *NSErrorUserInfoKey;
 | 
			
		||||
 | 
			
		||||
// Key in userInfo. A recommended standard way to embed NSErrors from underlying calls. The value of this key should be an NSError.
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSUnderlyingErrorKey;
 | 
			
		||||
 | 
			
		||||
// Key in userInfo. A recommended standard way to embed a list of several NSErrors from underlying calls. The value of this key should be an NSArray of NSError. This value is independent from the value of `NSUnderlyingErrorKey` - neither, one, or both may be set.
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSMultipleUnderlyingErrorsKey API_AVAILABLE(macos(11.3), ios(14.5), watchos(7.4), tvos(14.5));
 | 
			
		||||
 | 
			
		||||
// Keys in userInfo, for subsystems wishing to provide their error messages up-front. Note that NSError will also consult the userInfoValueProvider for the domain when these values are not present in the userInfo dictionary.
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSLocalizedDescriptionKey;             // NSString, a complete sentence (or more) describing ideally both what failed and why it failed.
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSLocalizedFailureReasonErrorKey;      // NSString, a complete sentence (or more) describing why the operation failed.
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSLocalizedRecoverySuggestionErrorKey; // NSString, a complete sentence (or more) describing what the user can do to fix the problem.
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSLocalizedRecoveryOptionsErrorKey;    // NSArray of NSStrings corresponding to button titles.
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSRecoveryAttempterErrorKey;           // Instance of a subclass of NSObject that conforms to the NSErrorRecoveryAttempting informal protocol
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSHelpAnchorErrorKey;                  // NSString containing a help anchor
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSDebugDescriptionErrorKey API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));     // NSString. This provides a string which will be shown when constructing the debugDescription of the NSError, to be used when debugging or when formatting the error with %@.  This string will never be used in localizedDescription, so will not be shown to the user.
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSLocalizedFailureErrorKey API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));  // NSString, a complete sentence (or more) describing what failed.  Setting a value for this key in userInfo dictionary of errors received from framework APIs is a good way to customize and fine tune the localizedDescription of an NSError.  As an example, for Foundation error code NSFileWriteOutOfSpaceError, setting the value of this key to "The image library could not be saved." will allow the localizedDescription of the error to come out as "The image library could not be saved. The volume Macintosh HD is out of space." rather than the default (say) “You can't save the file ImgDatabaseV2 because the volume Macintosh HD is out of space."
 | 
			
		||||
 | 
			
		||||
// Other standard keys in userInfo, for various error codes
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSStringEncodingErrorKey ;  // NSNumber containing NSStringEncoding
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSURLErrorKey;              // NSURL
 | 
			
		||||
FOUNDATION_EXPORT NSErrorUserInfoKey const NSFilePathErrorKey;         // NSString
 | 
			
		||||
 | 
			
		||||
@interface NSError : NSObject <NSCopying, NSSecureCoding> {
 | 
			
		||||
    @private
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
    NSInteger _code;
 | 
			
		||||
    NSString *_domain;
 | 
			
		||||
    NSDictionary *_userInfo;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Domain cannot be nil; dict may be nil if no userInfo desired.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithDomain:(NSErrorDomain)domain code:(NSInteger)code userInfo:(nullable NSDictionary<NSErrorUserInfoKey, id> *)dict NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
+ (instancetype)errorWithDomain:(NSErrorDomain)domain code:(NSInteger)code userInfo:(nullable NSDictionary<NSErrorUserInfoKey, id> *)dict;
 | 
			
		||||
 | 
			
		||||
/* These define the error. Domains are described by names that are arbitrary strings used to differentiate groups of codes; for custom domain using reverse-DNS naming will help avoid conflicts. Codes are domain-specific.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSErrorDomain domain;
 | 
			
		||||
@property (readonly) NSInteger code;
 | 
			
		||||
 | 
			
		||||
/* Additional info which may be used to describe the error further. Examples of keys that might be included in here are "Line Number", "Failed URL", etc. Embedding other errors in here can also be used as a way to communicate underlying reasons for failures; for instance "File System Error" embedded in the userInfo of an NSError returned from a higher level document object. If the embedded error information is itself NSError, the standard key NSUnderlyingErrorKey can be used.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSDictionary<NSErrorUserInfoKey, id> *userInfo;
 | 
			
		||||
 | 
			
		||||
/* The primary user-presentable message for the error, for instance for NSFileReadNoPermissionError: "The file "File Name" couldn't be opened because you don't have permission to view it.". This message should ideally indicate what failed and why it failed. This value either comes from NSLocalizedDescriptionKey, or NSLocalizedFailureErrorKey+NSLocalizedFailureReasonErrorKey, or NSLocalizedFailureErrorKey. The steps this takes to construct the description include:
 | 
			
		||||
 1. Look for NSLocalizedDescriptionKey in userInfo, use value as-is if present.
 | 
			
		||||
 2. Look for NSLocalizedFailureErrorKey in userInfo. If present, use, combining with value for NSLocalizedFailureReasonErrorKey if available.
 | 
			
		||||
 3. Fetch NSLocalizedDescriptionKey from userInfoValueProvider, use value as-is if present.
 | 
			
		||||
 4. Fetch NSLocalizedFailureErrorKey from userInfoValueProvider. If present, use, combining with value for NSLocalizedFailureReasonErrorKey if available.
 | 
			
		||||
 5. Look for NSLocalizedFailureReasonErrorKey in userInfo or from userInfoValueProvider; combine with generic "Operation failed" message.
 | 
			
		||||
 6. Last resort localized but barely-presentable string manufactured from domain and code. The result is never nil.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSString *localizedDescription;
 | 
			
		||||
 | 
			
		||||
/* Return a complete sentence which describes why the operation failed. For instance, for NSFileReadNoPermissionError: "You don't have permission.". In many cases this will be just the "because" part of the error message (but as a complete sentence, which makes localization easier).  Default implementation of this picks up the value of NSLocalizedFailureReasonErrorKey from the userInfo dictionary. If not present, it consults the userInfoValueProvider for the domain, and if that returns nil, this also returns nil.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *localizedFailureReason;
 | 
			
		||||
 | 
			
		||||
/* Return the string that can be displayed as the "informative" (aka "secondary") message on an alert panel. For instance, for NSFileReadNoPermissionError: "To view or change permissions, select the item in the Finder and choose File > Get Info.". Default implementation of this picks up the value of NSLocalizedRecoverySuggestionErrorKey from the userInfo dictionary. If not present, it consults the userInfoValueProvider for the domain, and if that returns nil, this also returns nil.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *localizedRecoverySuggestion;
 | 
			
		||||
 | 
			
		||||
/* Return titles of buttons that are appropriate for displaying in an alert. These should match the string provided as a part of localizedRecoverySuggestion.  The first string would be the title of the right-most and default button, the second one next to it, and so on. If used in an alert the corresponding default return values are NSAlertFirstButtonReturn + n. Default implementation of this picks up the value of NSLocalizedRecoveryOptionsErrorKey from the userInfo dictionary. If not present, it consults the userInfoValueProvider for the domain, and if that returns nil, this also returns nil. nil return usually implies no special suggestion, which would imply a single "OK" button.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSString *> *localizedRecoveryOptions;
 | 
			
		||||
 | 
			
		||||
/* Return an object that conforms to the NSErrorRecoveryAttempting informal protocol. The recovery attempter must be an object that can correctly interpret an index into the array returned by localizedRecoveryOptions. The default implementation of this picks up the value of NSRecoveryAttempterErrorKey from the userInfo dictionary. If not present, it consults the userInfoValueProvider for the domain. If that returns nil, this also returns nil.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, strong) id recoveryAttempter;
 | 
			
		||||
 | 
			
		||||
/* Return the help anchor that can be used to create a help button to accompany the error when it's displayed to the user.  This is done automatically by +[NSAlert alertWithError:], which the presentError: variants in NSApplication go through. The default implementation of this picks up the value of the NSHelpAnchorErrorKey from the userInfo dictionary. If not present, it consults the userInfoValueProvider for the domain.  If that returns nil, this also returns nil.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *helpAnchor;
 | 
			
		||||
 | 
			
		||||
/* Return a list of underlying errors, if any. It includes the values of both NSUnderlyingErrorKey and NSMultipleUnderlyingErrorsKey. If there are no underlying errors, returns an empty array.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSArray<NSError *> *underlyingErrors API_AVAILABLE(macos(11.3), ios(14.5), watchos(7.4), tvos(14.5));
 | 
			
		||||
 | 
			
		||||
/* Specify a block which will be called from the implementations of localizedDescription, localizedFailureReason, localizedRecoverySuggestion, localizedRecoveryOptions, recoveryAttempter, helpAnchor, and debugDescription when the underlying value for these is not present in the userInfo dictionary of NSError instances with the specified domain.  The provider will be called with the userInfo key corresponding to the queried property: For instance, NSLocalizedDescriptionKey for localizedDescription.  The provider should return nil for any keys it is not able to provide and, very importantly, any keys it does not recognize (since we may extend the list of keys in future releases).
 | 
			
		||||
 | 
			
		||||
The specified block will be called synchronously at the time when the above properties are queried. The results are not cached.
 | 
			
		||||
 | 
			
		||||
This provider is optional. It enables localization and formatting of error messages to be done lazily; rather than populating the userInfo at NSError creation time, these keys will be fetched on-demand when asked for.
 | 
			
		||||
 
 | 
			
		||||
It is expected that only the “owner” of an NSError domain specifies the provider for the domain, and this is done once. This facility is not meant for consumers of errors to customize the userInfo entries.  This facility should not be used to customize the behaviors of error domains provided by the system.
 | 
			
		||||
 
 | 
			
		||||
If an appropriate result for the requested key cannot be provided, return nil rather than choosing to manufacture a generic fallback response such as "Operation could not be completed, error 42." NSError will take care of the fallback cases.
 | 
			
		||||
*/
 | 
			
		||||
+ (void)setUserInfoValueProviderForDomain:(NSErrorDomain)errorDomain provider:(id _Nullable (^ _Nullable)(NSError *err, NSErrorUserInfoKey userInfoKey))provider API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (id _Nullable (^ _Nullable)(NSError *err, NSErrorUserInfoKey userInfoKey))userInfoValueProviderForDomain:(NSErrorDomain)errorDomain API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSObject(NSErrorRecoveryAttempting)
 | 
			
		||||
 | 
			
		||||
/* Given that an error alert has been presented document-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and send the selected message to the specified delegate. The option index is an index into the error's array of localized recovery options. The method selected by didRecoverSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
The value passed for didRecover must be YES if error recovery was completely successful, NO otherwise.
 | 
			
		||||
*/
 | 
			
		||||
- (void)attemptRecoveryFromError:(NSError *)error optionIndex:(NSUInteger)recoveryOptionIndex delegate:(nullable id)delegate didRecoverSelector:(nullable SEL)didRecoverSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
/* Given that an error alert has been presented applicaton-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and return YES if error recovery was completely successful, NO otherwise. The recovery option index is an index into the error's array of localized recovery options.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)attemptRecoveryFromError:(NSError *)error optionIndex:(NSUInteger)recoveryOptionIndex;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,300 @@
 | 
			
		||||
/*	NSException.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <stdarg.h>
 | 
			
		||||
#import <setjmp.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSDictionary, NSArray<ObjectType>, NSNumber;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/***************	Generic Exception names		***************/
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSGenericException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSRangeException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSInvalidArgumentException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSInternalInconsistencyException;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSMallocException;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSObjectInaccessibleException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSObjectNotAvailableException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSDestinationInvalidException;
 | 
			
		||||
    
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSPortTimeoutException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSInvalidSendPortException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSInvalidReceivePortException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSPortSendException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSPortReceiveException;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSOldStyleException;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSInconsistentArchiveException;
 | 
			
		||||
 | 
			
		||||
/***************	Exception object	***************/
 | 
			
		||||
 | 
			
		||||
#if __OBJC2__
 | 
			
		||||
__attribute__((__objc_exception__))
 | 
			
		||||
#endif
 | 
			
		||||
@interface NSException : NSObject <NSCopying, NSSecureCoding> {
 | 
			
		||||
    @private
 | 
			
		||||
    NSString		*name;
 | 
			
		||||
    NSString		*reason;
 | 
			
		||||
    NSDictionary	*userInfo;
 | 
			
		||||
    id			reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
+ (NSException *)exceptionWithName:(NSExceptionName)name reason:(nullable NSString *)reason userInfo:(nullable NSDictionary *)userInfo;
 | 
			
		||||
- (instancetype)initWithName:(NSExceptionName)aName reason:(nullable NSString *)aReason userInfo:(nullable NSDictionary *)aUserInfo NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSExceptionName name;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *reason;
 | 
			
		||||
@property (nullable, readonly, copy) NSDictionary *userInfo;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSNumber *> *callStackReturnAddresses API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *callStackSymbols API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (void)raise;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSException (NSExceptionRaisingConveniences)
 | 
			
		||||
 | 
			
		||||
+ (void)raise:(NSExceptionName)name format:(NSString *)format, ... NS_FORMAT_FUNCTION(2,3);
 | 
			
		||||
+ (void)raise:(NSExceptionName)name format:(NSString *)format arguments:(va_list)argList NS_FORMAT_FUNCTION(2,0);
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define NS_DURING		@try {
 | 
			
		||||
#define NS_HANDLER		} @catch (NSException *localException) {
 | 
			
		||||
#define NS_ENDHANDLER		}
 | 
			
		||||
#define NS_VALUERETURN(v,t)	return (v)
 | 
			
		||||
#define NS_VOIDRETURN		return
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef void NSUncaughtExceptionHandler(NSException *exception);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSUncaughtExceptionHandler * _Nullable NSGetUncaughtExceptionHandler(void);
 | 
			
		||||
FOUNDATION_EXPORT void NSSetUncaughtExceptionHandler(NSUncaughtExceptionHandler * _Nullable);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if __clang__
 | 
			
		||||
#define __PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _Pragma("clang diagnostic push") \
 | 
			
		||||
    _Pragma("clang diagnostic ignored \"-Wformat-extra-args\"")
 | 
			
		||||
 | 
			
		||||
#define __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS _Pragma("clang diagnostic pop")
 | 
			
		||||
#else
 | 
			
		||||
#define __PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
#define __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@class NSAssertionHandler;
 | 
			
		||||
 | 
			
		||||
#if (defined(__STDC_VERSION__) && (199901L <= __STDC_VERSION__)) || (defined(__cplusplus) && (201103L <= __cplusplus))
 | 
			
		||||
 | 
			
		||||
#if !defined(NS_BLOCK_ASSERTIONS)
 | 
			
		||||
 | 
			
		||||
#if !defined(_NSAssertBody)
 | 
			
		||||
#define NSAssert(condition, desc, ...)	\
 | 
			
		||||
    do {				\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
	if (__builtin_expect(!(condition), 0)) {		\
 | 
			
		||||
	    [[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd \
 | 
			
		||||
		object:self file:@(__FILE_NAME__) \
 | 
			
		||||
	    	lineNumber:__LINE__ description:(desc), ##__VA_ARGS__]; \
 | 
			
		||||
	}				\
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    } while(0)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(_NSCAssertBody)
 | 
			
		||||
#define NSCAssert(condition, desc, ...) \
 | 
			
		||||
    do {				\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
	if (__builtin_expect(!(condition), 0)) {		\
 | 
			
		||||
	    [[NSAssertionHandler currentHandler] handleFailureInFunction:(NSString * _Nonnull)@(__PRETTY_FUNCTION__) \
 | 
			
		||||
		file:@(__FILE_NAME__) \
 | 
			
		||||
	    	lineNumber:__LINE__ description:(desc), ##__VA_ARGS__]; \
 | 
			
		||||
	}				\
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    } while(0)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#else // NS_BLOCK_ASSERTIONS defined
 | 
			
		||||
 | 
			
		||||
#if !defined(_NSAssertBody)
 | 
			
		||||
#define NSAssert(condition, desc, ...) do {} while (0)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(_NSCAssertBody)
 | 
			
		||||
#define NSCAssert(condition, desc, ...) do {} while (0)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(_NSAssertBody)
 | 
			
		||||
#define NSAssert1(condition, desc, arg1) NSAssert((condition), (desc), (arg1))
 | 
			
		||||
#define NSAssert2(condition, desc, arg1, arg2) NSAssert((condition), (desc), (arg1), (arg2))
 | 
			
		||||
#define NSAssert3(condition, desc, arg1, arg2, arg3) NSAssert((condition), (desc), (arg1), (arg2), (arg3))
 | 
			
		||||
#define NSAssert4(condition, desc, arg1, arg2, arg3, arg4) NSAssert((condition), (desc), (arg1), (arg2), (arg3), (arg4))
 | 
			
		||||
#define NSAssert5(condition, desc, arg1, arg2, arg3, arg4, arg5) NSAssert((condition), (desc), (arg1), (arg2), (arg3), (arg4), (arg5))
 | 
			
		||||
#define NSParameterAssert(condition) NSAssert((condition), @"Invalid parameter not satisfying: %@", @#condition)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(_NSCAssertBody)
 | 
			
		||||
#define NSCAssert1(condition, desc, arg1) NSCAssert((condition), (desc), (arg1))
 | 
			
		||||
#define NSCAssert2(condition, desc, arg1, arg2) NSCAssert((condition), (desc), (arg1), (arg2))
 | 
			
		||||
#define NSCAssert3(condition, desc, arg1, arg2, arg3) NSCAssert((condition), (desc), (arg1), (arg2), (arg3))
 | 
			
		||||
#define NSCAssert4(condition, desc, arg1, arg2, arg3, arg4) NSCAssert((condition), (desc), (arg1), (arg2), (arg3), (arg4))
 | 
			
		||||
#define NSCAssert5(condition, desc, arg1, arg2, arg3, arg4, arg5) NSCAssert((condition), (desc), (arg1), (arg2), (arg3), (arg4), (arg5))
 | 
			
		||||
#define NSCParameterAssert(condition) NSCAssert((condition), @"Invalid parameter not satisfying: %@", @#condition)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Non-vararg implementation of asserts (ignore) */
 | 
			
		||||
#if !defined(NS_BLOCK_ASSERTIONS)
 | 
			
		||||
#if !defined(_NSAssertBody)
 | 
			
		||||
#define _NSAssertBody(condition, desc, arg1, arg2, arg3, arg4, arg5)	\
 | 
			
		||||
    do {						\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
	if (!(condition)) {				\
 | 
			
		||||
            NSString *__assert_file__ = [NSString stringWithUTF8String:__FILE__]; \
 | 
			
		||||
            __assert_file__ = __assert_file__ ? __assert_file__ : @"<Unknown File>"; \
 | 
			
		||||
	    [[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd object:self file:__assert_file__ \
 | 
			
		||||
	    	lineNumber:__LINE__ description:(desc), (arg1), (arg2), (arg3), (arg4), (arg5)];	\
 | 
			
		||||
	}						\
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    } while(0)
 | 
			
		||||
#endif
 | 
			
		||||
#if !defined(_NSCAssertBody)
 | 
			
		||||
#define _NSCAssertBody(condition, desc, arg1, arg2, arg3, arg4, arg5)	\
 | 
			
		||||
    do {						\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
	if (!(condition)) {				\
 | 
			
		||||
            NSString *__assert_fn__ = [NSString stringWithUTF8String:__PRETTY_FUNCTION__]; \
 | 
			
		||||
            __assert_fn__ = __assert_fn__ ? __assert_fn__ : @"<Unknown Function>"; \
 | 
			
		||||
            NSString *__assert_file__ = [NSString stringWithUTF8String:__FILE__]; \
 | 
			
		||||
            __assert_file__ = __assert_file__ ? __assert_file__ : @"<Unknown File>"; \
 | 
			
		||||
	    [[NSAssertionHandler currentHandler] handleFailureInFunction:__assert_fn__ file:__assert_file__ \
 | 
			
		||||
	    	lineNumber:__LINE__ description:(desc), (arg1), (arg2), (arg3), (arg4), (arg5)];	\
 | 
			
		||||
	}						\
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    } while(0)
 | 
			
		||||
#endif
 | 
			
		||||
#else
 | 
			
		||||
#if !defined(_NSAssertBody)
 | 
			
		||||
#define _NSAssertBody(condition, desc, arg1, arg2, arg3, arg4, arg5)
 | 
			
		||||
#endif
 | 
			
		||||
#if !defined(_NSCAssertBody)
 | 
			
		||||
#define _NSCAssertBody(condition, desc, arg1, arg2, arg3, arg4, arg5)
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Asserts to use in Objective-C method bodies
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
#if !defined(NSAssert)
 | 
			
		||||
#define NSAssert5(condition, desc, arg1, arg2, arg3, arg4, arg5)	\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSAssertBody((condition), (desc), (arg1), (arg2), (arg3), (arg4), (arg5)) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
 | 
			
		||||
#define NSAssert4(condition, desc, arg1, arg2, arg3, arg4)	\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSAssertBody((condition), (desc), (arg1), (arg2), (arg3), (arg4), 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
 | 
			
		||||
#define NSAssert3(condition, desc, arg1, arg2, arg3)	\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSAssertBody((condition), (desc), (arg1), (arg2), (arg3), 0, 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
 | 
			
		||||
#define NSAssert2(condition, desc, arg1, arg2)		\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSAssertBody((condition), (desc), (arg1), (arg2), 0, 0, 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
 | 
			
		||||
#define NSAssert1(condition, desc, arg1)		\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSAssertBody((condition), (desc), (arg1), 0, 0, 0, 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
 | 
			
		||||
#define NSAssert(condition, desc)			\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSAssertBody((condition), (desc), 0, 0, 0, 0, 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(NSParameterAssert)
 | 
			
		||||
#define NSParameterAssert(condition)			\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSAssertBody((condition), @"Invalid parameter not satisfying: %s", #condition, 0, 0, 0, 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if !defined(NSCAssert)
 | 
			
		||||
#define NSCAssert5(condition, desc, arg1, arg2, arg3, arg4, arg5)	\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSCAssertBody((condition), (desc), (arg1), (arg2), (arg3), (arg4), (arg5)) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
 | 
			
		||||
#define NSCAssert4(condition, desc, arg1, arg2, arg3, arg4)	\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSCAssertBody((condition), (desc), (arg1), (arg2), (arg3), (arg4), 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
 | 
			
		||||
#define NSCAssert3(condition, desc, arg1, arg2, arg3)	\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSCAssertBody((condition), (desc), (arg1), (arg2), (arg3), 0, 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
 | 
			
		||||
#define NSCAssert2(condition, desc, arg1, arg2)	\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSCAssertBody((condition), (desc), (arg1), (arg2), 0, 0, 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
 | 
			
		||||
#define NSCAssert1(condition, desc, arg1)		\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSCAssertBody((condition), (desc), (arg1), 0, 0, 0, 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
 | 
			
		||||
#define NSCAssert(condition, desc)			\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSCAssertBody((condition), (desc), 0, 0, 0, 0, 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(NSCParameterAssert)
 | 
			
		||||
#define NSCParameterAssert(condition)			\
 | 
			
		||||
	__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS \
 | 
			
		||||
    _NSCAssertBody((condition), @"Invalid parameter not satisfying: %s", #condition, 0, 0, 0, 0) \
 | 
			
		||||
        __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSAssertionHandlerKey API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@interface NSAssertionHandler : NSObject {
 | 
			
		||||
    @private
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSAssertionHandler *currentHandler;
 | 
			
		||||
 | 
			
		||||
- (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line description:(nullable NSString *)format,... NS_FORMAT_FUNCTION(5,6);
 | 
			
		||||
 | 
			
		||||
- (void)handleFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line description:(nullable NSString *)format,... NS_FORMAT_FUNCTION(4,5);
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,137 @@
 | 
			
		||||
/*	NSExpression.h
 | 
			
		||||
	Copyright (c) 2004-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSString;
 | 
			
		||||
@class NSArray<ObjectType>;
 | 
			
		||||
@class NSMutableDictionary;
 | 
			
		||||
@class NSPredicate;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
// Expressions are the core of the predicate implementation. When expressionValueWithObject: is called, the expression is evaluated, and a value returned which can then be handled by an operator. Expressions can be anything from constants to method invocations. Scalars should be wrapped in appropriate NSValue classes.
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSExpressionType) {
 | 
			
		||||
    NSConstantValueExpressionType = 0, // Expression that always returns the same value
 | 
			
		||||
    NSEvaluatedObjectExpressionType, // Expression that always returns the parameter object itself
 | 
			
		||||
    NSVariableExpressionType, // Expression that always returns whatever is stored at 'variable' in the bindings dictionary
 | 
			
		||||
    NSKeyPathExpressionType, // Expression that returns something that can be used as a key path
 | 
			
		||||
    NSFunctionExpressionType, // Expression that returns the result of evaluating a symbol
 | 
			
		||||
    NSUnionSetExpressionType API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)), // Expression that returns the result of doing a unionSet: on two expressions that evaluate to flat collections (arrays or sets)
 | 
			
		||||
    NSIntersectSetExpressionType API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)), // Expression that returns the result of doing an intersectSet: on two expressions that evaluate to flat collections (arrays or sets)
 | 
			
		||||
    NSMinusSetExpressionType API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)), // Expression that returns the result of doing a minusSet: on two expressions that evaluate to flat collections (arrays or sets)
 | 
			
		||||
    NSSubqueryExpressionType API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)) = 13,
 | 
			
		||||
    NSAggregateExpressionType API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)) = 14,
 | 
			
		||||
    NSAnyKeyExpressionType API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = 15,
 | 
			
		||||
    NSBlockExpressionType = 19,
 | 
			
		||||
    NSConditionalExpressionType API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = 20
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.4), ios(3.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSExpression : NSObject <NSSecureCoding, NSCopying> {
 | 
			
		||||
    @package
 | 
			
		||||
    struct _expressionFlags {
 | 
			
		||||
        unsigned int _evaluationBlocked:1;
 | 
			
		||||
        unsigned int _reservedExpressionFlags:31;
 | 
			
		||||
    } _expressionFlags;
 | 
			
		||||
#ifdef __LP64__
 | 
			
		||||
    uint32_t reserved;
 | 
			
		||||
#endif
 | 
			
		||||
    NSExpressionType _expressionType;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
+ (NSExpression *)expressionWithFormat:(NSString *)expressionFormat argumentArray:(NSArray *)arguments API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (NSExpression *)expressionWithFormat:(NSString *)expressionFormat, ...  API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (NSExpression *)expressionWithFormat:(NSString *)expressionFormat arguments:(va_list)argList API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
+ (NSExpression *)expressionForConstantValue:(nullable id)obj;    // Expression that returns a constant value
 | 
			
		||||
+ (NSExpression *)expressionForEvaluatedObject;    // Expression that returns the object being evaluated
 | 
			
		||||
+ (NSExpression *)expressionForVariable:(NSString *)string;    // Expression that pulls a value from the variable bindings dictionary
 | 
			
		||||
+ (NSExpression *)expressionForKeyPath:(NSString *)keyPath;    // Expression that invokes valueForKeyPath with keyPath
 | 
			
		||||
+ (NSExpression *)expressionForFunction:(NSString *)name arguments:(NSArray *)parameters;    // Expression that invokes one of the predefined functions. Will throw immediately if the selector is bad; will throw at runtime if the parameters are incorrect.
 | 
			
		||||
    // Predefined functions are:
 | 
			
		||||
    // name              parameter array contents				returns
 | 
			
		||||
	//-------------------------------------------------------------------------------------------------------------------------------------
 | 
			
		||||
    // sum:              NSExpression instances representing numbers		NSNumber 
 | 
			
		||||
    // count:            NSExpression instances representing numbers		NSNumber 
 | 
			
		||||
    // min:              NSExpression instances representing numbers		NSNumber  
 | 
			
		||||
    // max:              NSExpression instances representing numbers		NSNumber
 | 
			
		||||
    // average:          NSExpression instances representing numbers		NSNumber
 | 
			
		||||
    // median:           NSExpression instances representing numbers		NSNumber
 | 
			
		||||
    // mode:             NSExpression instances representing numbers		NSArray	    (returned array will contain all occurrences of the mode)
 | 
			
		||||
    // stddev:           NSExpression instances representing numbers		NSNumber
 | 
			
		||||
    // add:to:           NSExpression instances representing numbers		NSNumber
 | 
			
		||||
    // from:subtract:    two NSExpression instances representing numbers	NSNumber
 | 
			
		||||
    // multiply:by:      two NSExpression instances representing numbers	NSNumber
 | 
			
		||||
    // divide:by:        two NSExpression instances representing numbers	NSNumber
 | 
			
		||||
    // modulus:by:       two NSExpression instances representing numbers	NSNumber
 | 
			
		||||
    // sqrt:             one NSExpression instance representing numbers		NSNumber
 | 
			
		||||
    // log:              one NSExpression instance representing a number	NSNumber
 | 
			
		||||
    // ln:               one NSExpression instance representing a number	NSNumber
 | 
			
		||||
    // raise:toPower:    one NSExpression instance representing a number	NSNumber
 | 
			
		||||
    // exp:              one NSExpression instance representing a number	NSNumber
 | 
			
		||||
    // floor:            one NSExpression instance representing a number	NSNumber
 | 
			
		||||
    // ceiling:          one NSExpression instance representing a number	NSNumber
 | 
			
		||||
    // abs:              one NSExpression instance representing a number	NSNumber
 | 
			
		||||
    // trunc:            one NSExpression instance representing a number	NSNumber
 | 
			
		||||
    // uppercase:	 one NSExpression instance representing a string	NSString
 | 
			
		||||
    // lowercase:        one NSExpression instance representing a string    NSString
 | 
			
		||||
    // canonical:        one NSExpression instance representing a string    NSString
 | 
			
		||||
    // random            none							NSNumber (integer)
 | 
			
		||||
    // randomn:          one NSExpression instance representing a number	NSNumber (integer) such that 0 <= rand < param
 | 
			
		||||
    // now               none							[NSDate now]
 | 
			
		||||
    // bitwiseAnd:with:	 two NSExpression instances representing numbers	NSNumber    (numbers will be treated as NSInteger)
 | 
			
		||||
    // bitwiseOr:with:	 two NSExpression instances representing numbers	NSNumber    (numbers will be treated as NSInteger)
 | 
			
		||||
    // bitwiseXor:with:	 two NSExpression instances representing numbers	NSNumber    (numbers will be treated as NSInteger)
 | 
			
		||||
    // leftshift:by:	 two NSExpression instances representing numbers	NSNumber    (numbers will be treated as NSInteger)
 | 
			
		||||
    // rightshift:by:	 two NSExpression instances representing numbers	NSNumber    (numbers will be treated as NSInteger)
 | 
			
		||||
    // onesComplement:	 one NSExpression instance representing a numbers	NSNumber    (numbers will be treated as NSInteger)
 | 
			
		||||
    // noindex:		 an NSExpression					parameter   (used by CoreData to indicate that an index should be dropped)
 | 
			
		||||
    // distanceToLocation:fromLocation:
 | 
			
		||||
    //                   two NSExpression instances representing CLLocations    NSNumber
 | 
			
		||||
    // length:           an NSExpression instance representing a string         NSNumber
 | 
			
		||||
 | 
			
		||||
+ (NSExpression *)expressionForAggregate:(NSArray<NSExpression *> *)subexpressions API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)); // Expression that returns a collection containing the results of other expressions
 | 
			
		||||
+ (NSExpression *)expressionForUnionSet:(NSExpression *)left with:(NSExpression *)right API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)); // return an expression that will return the union of the collections expressed by left and right
 | 
			
		||||
+ (NSExpression *)expressionForIntersectSet:(NSExpression *)left with:(NSExpression *)right API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)); // return an expression that will return the intersection of the collections expressed by left and right
 | 
			
		||||
+ (NSExpression *)expressionForMinusSet:(NSExpression *)left with:(NSExpression *)right API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)); // return an expression that will return the disjunction of the collections expressed by left and right
 | 
			
		||||
+ (NSExpression *)expressionForSubquery:(NSExpression *)expression usingIteratorVariable:(NSString *)variable predicate:(NSPredicate *)predicate API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)); // Expression that filters a collection by storing elements in the collection in the variable variable and keeping the elements for which qualifer returns true; variable is used as a local variable, and will shadow any instances of variable in the bindings dictionary, the variable is removed or the old value replaced once evaluation completes
 | 
			
		||||
+ (NSExpression *)expressionForFunction:(NSExpression *)target selectorName:(NSString *)name arguments:(nullable NSArray *)parameters API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0));    // Expression that invokes the selector on target with parameters. Will throw at runtime if target does not implement selector or if parameters are wrong.
 | 
			
		||||
+ (NSExpression *)expressionForAnyKey API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (NSExpression *)expressionForBlock:(id (^)(id _Nullable evaluatedObject, NSArray<NSExpression *> *expressions, NSMutableDictionary * _Nullable context))block arguments:(nullable NSArray<NSExpression *> *)arguments API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)); // Expression that invokes the block with the parameters; note that block expressions are not encodable or representable as parseable strings.
 | 
			
		||||
+ (NSExpression *)expressionForConditional:(NSPredicate *)predicate trueExpression:(NSExpression *)trueExpression falseExpression:(NSExpression *)falseExpression  API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)); // Expression that will return the result of trueExpression or falseExpression depending on the value of predicate
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithExpressionType:(NSExpressionType)type NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
// accessors for individual parameters - raise if not applicable
 | 
			
		||||
@property (readonly) NSExpressionType expressionType;
 | 
			
		||||
@property (nullable, readonly, retain) id constantValue;
 | 
			
		||||
@property (readonly, copy) NSString *keyPath;
 | 
			
		||||
@property (readonly, copy) NSString *function;
 | 
			
		||||
@property (readonly, copy) NSString *variable;
 | 
			
		||||
@property (readonly, copy) NSExpression *operand;    // the object on which the selector will be invoked (the result of evaluating a key path or one of the defined functions)
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSExpression *> *arguments;    // array of expressions which will be passed as parameters during invocation of the selector on the operand of a function expression
 | 
			
		||||
 | 
			
		||||
@property (readonly, retain) id collection API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSPredicate *predicate API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSExpression *leftExpression API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)); // expression which represents the left side of a set expression
 | 
			
		||||
@property (readonly, copy) NSExpression *rightExpression API_AVAILABLE(macos(10.5), ios(3.0), watchos(2.0), tvos(9.0)); // expression which represents the right side of a set expression
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSExpression *trueExpression API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)); // expression which will be evaluated if a conditional expression's predicate evaluates to true
 | 
			
		||||
@property (readonly, copy) NSExpression *falseExpression API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)); // expression which will be evaluated if a conditional expression's predicate evaluates to false
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) id (^expressionBlock)(id _Nullable, NSArray<NSExpression *> *, NSMutableDictionary * _Nullable) API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// evaluate the expression using the object and bindings- note that context is mutable here and can be used by expressions to store temporary state for one predicate evaluation
 | 
			
		||||
- (nullable id)expressionValueWithObject:(nullable id)object context:(nullable NSMutableDictionary *)context;
 | 
			
		||||
 | 
			
		||||
- (void)allowEvaluation API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)); // Force an expression which was securely decoded to allow evaluation
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,46 @@
 | 
			
		||||
/*	NSExtensionContext.h
 | 
			
		||||
        Copyright (c) 2013-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
 | 
			
		||||
#if __OBJC2__
 | 
			
		||||
 | 
			
		||||
// Class representing the extension request's context
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSExtensionContext : NSObject
 | 
			
		||||
 | 
			
		||||
// The list of input NSExtensionItems associated with the context. If the context has no input items, this array will be empty.
 | 
			
		||||
@property(readonly, copy, NS_NONATOMIC_IOSONLY) NSArray *inputItems;
 | 
			
		||||
 | 
			
		||||
// Signals the host to complete the app extension request with the supplied result items. The completion handler optionally contains any work which the extension may need to perform after the request has been completed, as a background-priority task. The `expired` parameter will be YES if the system decides to prematurely terminate a previous non-expiration invocation of the completionHandler. Note: calling this method will eventually dismiss the associated view controller.
 | 
			
		||||
- (void)completeRequestReturningItems:(nullable NSArray *)items completionHandler:(void(^ _Nullable)(BOOL expired))completionHandler NS_SWIFT_DISABLE_ASYNC;
 | 
			
		||||
 | 
			
		||||
// Signals the host to cancel the app extension request, with the supplied error, which should be non-nil. The userInfo of the NSError will contain a key NSExtensionItemsAndErrorsKey which will have as its value a dictionary of NSExtensionItems and associated NSError instances.
 | 
			
		||||
- (void)cancelRequestWithError:(NSError *)error;
 | 
			
		||||
 | 
			
		||||
// Asks the host to open a URL on the extension's behalf
 | 
			
		||||
- (void)openURL:(NSURL *)URL completionHandler:(void (^ _Nullable)(BOOL success))completionHandler;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// Key in userInfo. Value is a dictionary of NSExtensionItems and associated NSError instances.
 | 
			
		||||
FOUNDATION_EXTERN NSString * __null_unspecified const NSExtensionItemsAndErrorsKey API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// The host process will enter the foreground
 | 
			
		||||
FOUNDATION_EXTERN NSString * __null_unspecified const NSExtensionHostWillEnterForegroundNotification API_AVAILABLE(ios(8.2), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
 | 
			
		||||
 | 
			
		||||
// The host process did enter the background
 | 
			
		||||
FOUNDATION_EXTERN NSString * __null_unspecified const NSExtensionHostDidEnterBackgroundNotification API_AVAILABLE(ios(8.2), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
 | 
			
		||||
 | 
			
		||||
// The host process will resign active status (stop receiving events), the extension may be suspended
 | 
			
		||||
FOUNDATION_EXTERN NSString * __null_unspecified const NSExtensionHostWillResignActiveNotification API_AVAILABLE(ios(8.2), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
 | 
			
		||||
 | 
			
		||||
// The host process did become active (begin receiving events)
 | 
			
		||||
FOUNDATION_EXTERN NSString * __null_unspecified const NSExtensionHostDidBecomeActiveNotification API_AVAILABLE(ios(8.2), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -0,0 +1,35 @@
 | 
			
		||||
/*	NSExtensionItem.h
 | 
			
		||||
        Copyright (c) 2013-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <Foundation/NSItemProvider.h>
 | 
			
		||||
 | 
			
		||||
#if __OBJC2__
 | 
			
		||||
// A NSExtensionItem is an immutable collection of values representing different aspects of an item for the extension to act upon.
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSExtensionItem : NSObject<NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
// (optional) title for the item
 | 
			
		||||
@property(nullable, copy, NS_NONATOMIC_IOSONLY) NSAttributedString *attributedTitle;
 | 
			
		||||
 | 
			
		||||
// (optional) content text
 | 
			
		||||
@property(nullable, copy, NS_NONATOMIC_IOSONLY) NSAttributedString *attributedContentText;
 | 
			
		||||
 | 
			
		||||
// (optional) Contains images, videos, URLs, etc. This is not meant to be an array of alternate data formats/types, but instead a collection to include in a social media post for example.
 | 
			
		||||
@property(nullable, copy, NS_NONATOMIC_IOSONLY) NSArray<NSItemProvider *> *attachments;
 | 
			
		||||
 | 
			
		||||
// (optional) dictionary of key-value data. The key/value pairs accepted by the service are expected to be specified in the extension's Info.plist. The values of NSExtensionItem's properties will be reflected into the dictionary.
 | 
			
		||||
@property(nullable, copy, NS_NONATOMIC_IOSONLY) NSDictionary *userInfo;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// Keys corresponding to properties exposed on the NSExtensionItem interface
 | 
			
		||||
FOUNDATION_EXTERN NSString * _Null_unspecified const NSExtensionItemAttributedTitleKey API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXTERN NSString * _Null_unspecified const NSExtensionItemAttributedContentTextKey API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXTERN NSString * _Null_unspecified const NSExtensionItemAttachmentsKey API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
#endif
 | 
			
		||||
@@ -0,0 +1,23 @@
 | 
			
		||||
/*	NSExtensionRequestHandling.h
 | 
			
		||||
 Copyright (c) 2013-2019, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
 | 
			
		||||
#if __OBJC2__
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@class NSExtensionContext;
 | 
			
		||||
 | 
			
		||||
// The basic NSExtensionRequestHandling protocol defines a lifecycle hook into the extension. Non view-controller-based services might keep track of the current request using this method. Implemented by the principal object of the extension.
 | 
			
		||||
@protocol NSExtensionRequestHandling <NSObject>
 | 
			
		||||
 | 
			
		||||
@required
 | 
			
		||||
 | 
			
		||||
// Tells the extension to prepare its interface for the requesting context, and request related data items. At this point [(NS|UI)ViewController extensionContext] returns a non-nil value. This message is delivered after initialization, but before the conforming object will be asked to "do something" with the context (i.e. before -[(NS|UI)ViewController loadView]). Subclasses of classes conforming to this protocol are expected to call [super beginRequestWithExtensionContext:] if this method is overridden.
 | 
			
		||||
- (void)beginRequestWithExtensionContext:(NSExtensionContext *)context;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
#endif
 | 
			
		||||
@@ -0,0 +1,240 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFileCoordinator.h
 | 
			
		||||
	Copyright (c) 2010-2019, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSURL.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>, NSError, NSMutableDictionary, NSOperationQueue, NSSet<ObjectType>;
 | 
			
		||||
 | 
			
		||||
@protocol NSFilePresenter;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFileCoordinatorReadingOptions) {
 | 
			
		||||
 | 
			
		||||
    /* Whether reading does _not_ trigger sending of -savePresentedItemChangesWithCompletionHandler: to certain NSFilePresenters in the system and waiting for those NSFilePresenters to respond. The default behavior during coordinated reading is to send -savePresentedItemChangesWithCompletionHandler: to NSFilePresenters.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileCoordinatorReadingWithoutChanges = 1 << 0,
 | 
			
		||||
 | 
			
		||||
    /* Whether reading of an item that might be a symbolic link file causes the resolution of the link if it is. This affects the URL passed to the block passed to an invocation of one of the -coordinateReadingItemAtURL:... methods. This is not a valid option to use with -prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileCoordinatorReadingResolvesSymbolicLink = 1 << 1,
 | 
			
		||||
 | 
			
		||||
    /* Whether the reading to be done will only attempt to get an item's metadata that is immediately available (name, modification date, tags, and other attributes), and not its contents. For ubiquitous items, specifying this option will cause coordinated reads to be granted immediately (barring other coordinated readers or writers or file presenters on the same system on the same system preventing this) instead of waiting for any downloading of contents or additional metadata like conflicting versions or thumbnails. Attempting to read the item's contents during such a coordinated read may give you unexpected results or fail.
 | 
			
		||||
     */
 | 
			
		||||
    NSFileCoordinatorReadingImmediatelyAvailableMetadataOnly API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) = 1 << 2,
 | 
			
		||||
 | 
			
		||||
    /* Whether reading of an item is being done for the purpose of uploading. When using this option, NSFileCoordinator will create a temporary snapshot of the item being read and will relinquish its claim on the file once that snapshot is made to avoid blocking other coordinated writes during a potentially long upload. If the item at the URL being read is a directory (such as a document package), then the snapshot will be a new file that contains the zipped contents of that directory, and the URL passed to the accessor block will locate that file.
 | 
			
		||||
     
 | 
			
		||||
    When using this option, you may upload the document outside of the accessor block. However, you should open a file descriptor to the file or relocate the file within the accessor block before you do so, because NSFileCoordinator will unlink the file after the block returns, rendering it inaccessible via the URL.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileCoordinatorReadingForUploading API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) = 1 << 3,
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFileCoordinatorWritingOptions) {
 | 
			
		||||
 | 
			
		||||
    /* You can use only one of these writing options at a time. Using none of them indicates that the writing will simply update the item.
 | 
			
		||||
    */
 | 
			
		||||
 | 
			
		||||
    /* Whether the writing to be done is actually the deletion of the item. This affects how the writing waits for previously scheduled coordinated reading and writing, how the writing causes subsequently scheduled reading and writing to wait, and what NSFilePresenter messaging is done. See the comments in the Single File Coordination section below. This option is how you trigger sending of -accommodatePresentedItemDeletionWithCompletionHandler: or -accommodatePresentedSubitemDeletionAtURL:completionHandler: messages to NSFilePresenters.
 | 
			
		||||
 | 
			
		||||
    For example, Finder uses this when it's emptying the trash to give NSFilePresenters a chance to close documents before their files disappear, or would disappear if the files weren't still open.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileCoordinatorWritingForDeleting = 1 << 0,
 | 
			
		||||
 | 
			
		||||
    /* Whether the writing to be done is actually the moving or renaming of the item. This affects how the writing waits for previously scheduled coordinated reading and writing, how the writing causes subsequently scheduled reading and writing to wait, and what NSFilePresenter messaging is done. See the comments in the Single File Coordination section below. This option has no effect when what's being moved is a plain file so you can use it in code that moves file system items without checking whether the items are files or directories. Any such check would invite a race condition anyway.
 | 
			
		||||
 | 
			
		||||
    For example, Finder uses this when it's moving items that the user has dragged and dropped so as not to yank files contained by moved folders out from underneath applications that are reading or writing those files.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileCoordinatorWritingForMoving = 1 << 1,
 | 
			
		||||
 | 
			
		||||
    /* Whether coordinated writing triggers sending of -savePresentedItemChangesWithCompletionHandler: to certain NSFilePresenters in the system and waiting for those NSFilePresenters to respond.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileCoordinatorWritingForMerging = 1 << 2,
 | 
			
		||||
 | 
			
		||||
    /* Whether the writing to be done is actually the replacement of the item with a different item. It causes the same behavior as NSFileCoordinatorWritingForDeleting except that when the item being written to is renamed or moved while the writer is being made to wait the item is considered to have been a different item, so the writer is not passed an updated URL to reflect the renaming or moving. Use this when the moving or creation of an item will replace any item that gets in its way. To avoid a race condition use it regardless of whether there is actually an item in the way before the writing begins. Don't use this when simply updating the contents of a file, even if the way you do that is writing the contents to another file and renaming it into place. This is not a valid option to use with -prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:.
 | 
			
		||||
 | 
			
		||||
    For example, NSDocument uses this for NSSaveAsOperation and NSSaveToOperation to announce that it is possibly overwriting an item with a brand new file or file package. This gives any NSFilePresenter of the overwritten item, including perhaps a different instance of NSDocument, perhaps in the same application, a chance to close itself before the item is overwritten.
 | 
			
		||||
 | 
			
		||||
    For another example, the most accurate and safe way to coordinate a move is to invoke -coordinateWritingItemAtURL:options:writingItemAtURL:options:error:byAccessor: using the NSFileCoordinatorWritingForMoving option with the source URL and NSFileCoordinatorWritingForReplacing with the destination URL.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileCoordinatorWritingForReplacing = 1 << 3,
 | 
			
		||||
 | 
			
		||||
    /* Whether the writing to be done will change the item's metadata only and not its contents. If the item being written to is ubiquitous, then changes to the item's contents during this coordinated write may not be preserved or fail. When using this option, changing metadata that is related to the item's contents is not supported for ubiquitous items and such changes may not be preserved. For example, changing the value of NSURLTagNamesKey is supported, but changing the value of NSURLContentModificationDateKey is not.
 | 
			
		||||
     */
 | 
			
		||||
    NSFileCoordinatorWritingContentIndependentMetadataOnly API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) = 1 << 4
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSFileAccessIntent : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    NSURL *_url;
 | 
			
		||||
    BOOL _isRead;
 | 
			
		||||
    NSInteger _options;
 | 
			
		||||
}
 | 
			
		||||
+ (instancetype)readingIntentWithURL:(NSURL *)url options:(NSFileCoordinatorReadingOptions)options;
 | 
			
		||||
+ (instancetype)writingIntentWithURL:(NSURL *)url options:(NSFileCoordinatorWritingOptions)options;
 | 
			
		||||
@property (readonly, copy) NSURL *URL; // Use this URL within the accessor block. This property may change from its original value in response to actions from other writers.
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSFileCoordinator : NSObject {
 | 
			
		||||
    @private
 | 
			
		||||
    id _accessArbiter;
 | 
			
		||||
    id _fileReactor;
 | 
			
		||||
    id _purposeID;
 | 
			
		||||
    NSURL *_recentFilePresenterURL;
 | 
			
		||||
    id _accessClaimIDOrIDs;
 | 
			
		||||
    BOOL _isCancelled;
 | 
			
		||||
    NSMutableDictionary *_movedItems;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#pragma mark *** File Presenters ***
 | 
			
		||||
 | 
			
		||||
/* The process' file presenters. If you invoke +addFilePresenter: you have to do a balancing invocation of +removeFilePresenter: before the file presenter is deallocated, even in a garbage-collected application.
 | 
			
		||||
 | 
			
		||||
If your application reads an item and then registers a file presenter for it there is a possible race condition in which between those two steps another process does coordinated reading or writing of the item, without any messages sent to your not-quite-registered file presenter. This can leave your file presenter ignorant of the fact that what it knows about the item it just read is already out of date, or under the misconception that just because it hasn't received a -relinquish... method it owns the item. To avoid that race condition you can invoke +addFilePresenter: in the same block that you pass to -coordinateReadingItemAtURL:options:error:byAccessor: to read what the file presenter will present.
 | 
			
		||||
*/
 | 
			
		||||
+ (void)addFilePresenter:(id<NSFilePresenter>)filePresenter;
 | 
			
		||||
+ (void)removeFilePresenter:(id<NSFilePresenter>)filePresenter;
 | 
			
		||||
@property (class, readonly, copy) NSArray<id<NSFilePresenter>> *filePresenters;
 | 
			
		||||
 | 
			
		||||
/* The designated initializer. If an NSFilePresenter is provided then the receiver is considered to have been created by that NSFilePresenter, or on its behalf.
 | 
			
		||||
 | 
			
		||||
NSFileCoordinator is meant to be instantiated on a per-file-operation basis, where a file operation is something like the opening or saving of a document, or the copying or moving of a batch of folders and files. There is no benefit to keeping an instance of it alive in your application for much more time than it takes to actually perform the file operation. Doing so can be harmful, or at least wasteful of memory, because NSFileCoordinators may retain NSFilePresenters.
 | 
			
		||||
 | 
			
		||||
You pass an NSFilePresenter to this initializer when the operation whose file access is to be coordinated is being performed by that NSFilePresenter. Associating an NSFileCoordinator with an NSFilePresenter accomplishes a few important things:
 | 
			
		||||
- It prevents the NSFileCoordinator from sending messages to that NSFilePresenter, so the NSFilePresenter does not have to somehow filter out messages about its own file operations. The exception to this rule is that messages about versions of the presented item being added, remove, or resolved during coordinated writing are sent to every relevant NSFilePresenter, even the one passed to -initWithFilePresenter:.
 | 
			
		||||
- It allows the file coordination mechanism to determine when coordinated writing is being done in response to an NSFilePresenter receiving a -savePresentedItemChangesWithCompletionHandler: message, and not deadlock. Usually coordinated writing done by one NSFileCoordinator must wait for coordinated reading of the same file or directory done by another NSFileCoordinator. But, for example, when coordinated reading is begun with one NSFileCoordinator, and that causes an NSFilePresenter to do coordinated writing using another NSFileCoordinator, the writing done with the second NSFileCoordinator should not wait for the completion of the first NSFileCoordinator's reading, it should instead happen while the first NSFileCoordinator is waiting to read.
 | 
			
		||||
- It allows the file coordination mechanism to handle a race condition that can occur when it has sent an NSFilePresenter a -presentedItemDidMoveToURL: message in the NSFilePresenter's operation queue but before that message is dequeued the NSFilePresenter enqueues, on a different queue, an operation using the old URL. For this to be effective however the NSFileCoordinator must be initialized in the same operation queue in which NSFilePresenter messages are received.
 | 
			
		||||
- It allows the file coordination mechanism to gracefully handle your application's registration of an NSFilePresenter that at first returns nil when sent -presentedItemURL but can later return non-nil at the end of doing a coordinated write that creates the presented item in the file system for the very first time. AppKit for example takes advantage of this by registering brand new untitled NSDocuments as NSFilePresenters immediately, instead of waiting until after the first time the user causes the document to be saved to a file, which would be more complicated.
 | 
			
		||||
 | 
			
		||||
For example, NSDocument creates a single NSFileCoordinator for all of the coordinated reading and writing it does during the saving of a document. It always creates the NSFileCoordinator in the main queue even when it is doing the actual coordinated reading and writing in a background queue to implement asynchronous saving.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithFilePresenter:(nullable id<NSFilePresenter>)filePresenterOrNil NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Purpose Identifier ***
 | 
			
		||||
 | 
			
		||||
/* A string that uniquely identifies the file access that will be done by this NSFileCoordinator. Every NSFileCoordinator has a unique purpose identifier that is created during initialization. Coordinated reads and writes performed by NSFileCoordinators with the same purpose identifier never block each other, even if they exist in different processes. In addition to some of the reasons explained in the comments of -initWithFilePresenter:, you may want to set a custom purpose identifier for the following reasons:
 | 
			
		||||
- Your application has an NSFileProviderExtension. Any file coordination done on behalf of the NSFileProviderExtension needs to be done using the same purpose identifier reported by your NSFileProviderExtension.
 | 
			
		||||
- To avoid deadlocking when two separate subsystems need to work together to perform one high-level operation, and both subsystems perform their own coordinated reads or writes.
 | 
			
		||||
 
 | 
			
		||||
If you are coordinating file access on behalf of an NSFilePresenter, you should use -initWithFilePresenter: and should not attempt to set a custom purpose identifier. Every NSFileCoordinator instance initialized with the same NSFilePresenter will have the same purpose identifier.
 | 
			
		||||
 
 | 
			
		||||
When creating custom purpose identifiers, you can use a reverse DNS style string, such as "com.mycompany.myapplication.mypurpose", or a UUID string. Nil and zero-length strings are not allowed.
 | 
			
		||||
 
 | 
			
		||||
Purpose identifiers can be set only once. If you attempt to set the purpose identifier of an NSFileCoordinator that you initialized with -initWithFilePresenter: or that you already assigned a purpose identifier, an exception will be thrown.
 | 
			
		||||
*/
 | 
			
		||||
@property (copy) NSString *purposeIdentifier API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Asynchronous File Coordination ***
 | 
			
		||||
 | 
			
		||||
/* You can consider "item" in method names and comments in this header file to be an abbreviation of "fileOrDirectory." As always, a directory might actually be a file package.
 | 
			
		||||
 | 
			
		||||
The term "reader" refers to an invocation of -coordinateAccessWithIntents:queue:byAccessor: with at least one NSFileAccessIntent created with +readingIntentWithURL:options:. Similarly, the term "writer" refers to an invocation of -coordinateAccessWithIntents:queue:byAccessor: with at least one NSFileAccessIntent created with +writingIntentWithURL:optiosn:.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Given an array of one or more NSFileAccessIntent objects that specify reading and/or writing items located by the corresponding URLs, wait asynchronously for certain other readers and writers and then invoke the passed-in block on the given queue, which must not be nil. If an error occurs, file access is not granted and a non-nil error will be passed to the accessor block. If file access is successfully granted, then 'error' will be nil and you may perform the intended file access inside the accessor block.
 | 
			
		||||
 
 | 
			
		||||
You must use the URL property on the NSFileAccessIntent objects when performing file access in the accessor block. Within the block, the NSFileAccessIntent objects' URLs may differ from their original values to account for items that have been moved or renamed while waiting for access to be granted. When access to the intended files is granted, certain other readers and writers are made to wait until the given block returns, which defines the end of that file access. Do not allow file access to continue after the accessor block returns by dispatching work to other threads or queues.
 | 
			
		||||
 
 | 
			
		||||
You can invoke this method to serialize your process's access of files and directories with other processes' access of the same files and directories so that inconsistencies due to overlapping reading and writing don't occur. It also causes messages to be sent to NSFilePresenters, and wait for NSFilePresenters to react, as described below. The fact that file system items can be moved or renamed while this method is waiting to invoke the block you passed when invoking it is why it's critical to use the URL property on the NSFileAccessIntent objects, not the URLs you used when initializing them.
 | 
			
		||||
 
 | 
			
		||||
In general a coordinated reader waits for a coordinated writer of the same item, and a coordinated writer waits for coordinated readers and other coordinated writers of the same item. Coordinated readers do not wait for each other. Coordinated reading or writing of items in a file package is treated as coordinated reading or writing of the file package as a whole. A coordinated reader of a directory that is not a file package does not wait for coordinated writers of contained items, or cause such writers to wait. With one exception, a coordinated writer of a directory that is not a file package does not wait for coordinated readers and writers of contained items, or cause such readers and writers to wait. The exception is when you use NSFileCoordinatorWritingForDeleting, NSFileCoordinatorWritingForMoving, or NSFileCoordinatorWritingForReplacing. They make your coordinated writer wait for previously scheduled coordinated readers and writers of contained items, and causes subsequently scheduled coordinated readers and writers of contained items to wait.
 | 
			
		||||
 
 | 
			
		||||
None of those rules apply to coordinated readers and writers that are using the exact same instance of NSFileCoordinator, including arrays of multiple NSFileAccessIntent objects. Instances of NSFileCoordinator never block themselves. You can take advantage of that in a couple of ways when invoking -coordinateAccessWithIntents:queue:byAccessor: multiple times on the same NSFileCoordinator instance, but take care because doing so raises the possibility of deadlocking with other processes that are doing the same sort of thing. If you can, you should invoke -coordinateAccessWithIntents:queue:byAccessor: a single time with multiple NSFileAccessIntent objects instead of invoking it multiple times with a single NSFileAccssIntent object.
 | 
			
		||||
 
 | 
			
		||||
In addition to waiting for writers, readers wait for NSFilePresenters that are messaged as part of the coordinated reading.
 | 
			
		||||
 
 | 
			
		||||
Coordinated reading of an item triggers the sending of messages to NSFilePresenters that implement the corresponding optional methods, even those in other processes, except the one specified when -initWithFilePresenter: was invoked:
 | 
			
		||||
- -relinquishPresentedItemToReader: is sent to NSFilePresenters of the item and, if the item is in a file package, NSFilePresenters of the file package. If there are nested file packages then the message is sent to NSFilePresenters of all of them.
 | 
			
		||||
- If NSFileCoordinatorReadingWithoutChanges is not used then -savePresentedItemChangesWithCompletionHandler: is also sent to the same NSFilePresenters.
 | 
			
		||||
 | 
			
		||||
In addition to waiting for readers and other writers, writers wait for NSFilePresenters that are messaged as part of the coordinated writing.
 | 
			
		||||
 
 | 
			
		||||
Coordinated writing of an item triggers the sending of messages to NSFilePresenters that implement the corresponding optional methods, even those in other processes, except the one specified when -initWithFilePresenter: was invoked:
 | 
			
		||||
- -relinquishPresentedItemToWriter: is sent to NSFilePresenters of the item and, if the item is in a file package, NSFilePresenters of the file package. If there are nested file packages then the message is sent to NSFilePresenters of all of them.
 | 
			
		||||
- If NSFileCoordinatorWritingForDeleting, NSFileCoordinatorWritingForMoving, or NSFileCoordinatorWritingForReplacing is used and the item is a directory then -relinquishPresentedItemToWriter: is also sent to NSFilePresenters of each item contained by it.
 | 
			
		||||
- If NSFileCoordinatorWritingForDeleting or NSFileCoordinatorWritingForReplacing is used then -accommodatePresentedItemDeletionWithCompletionHandler: is sent to NSFilePresenters of the item and, if the item is a directory, NSFilePresenters of each item contained by it. -accommodatePresentedSubitemDeletionAtURL:completionHandler: is sent to NSFilePresenters of each file package that contains the item.
 | 
			
		||||
- When NSFileCoordinatorWritingForReplacing is used the the definition of "the item" depends on what happened while waiting for other writers. See the description of it above.
 | 
			
		||||
- If NSFileCoordinatorWritingForMerging is used then -savePresentedItemChangesWithCompletionHandler: is sent to NSFilePresenters of the item and, if the item is in a file package, NSFilePresenters of the file package. If there are nested file packages then the message is sent to NSFilePresenters of all of them.
 | 
			
		||||
 
 | 
			
		||||
For both coordinated reading and writing, if there are multiple NSFilePresenters involved then the order in which they are messaged is undefined. If an NSFilePresenter signals failure then waiting will fail and *outError will be set to an NSError describing the failure.
 | 
			
		||||
*/
 | 
			
		||||
- (void)coordinateAccessWithIntents:(NSArray<NSFileAccessIntent *> *)intents queue:(NSOperationQueue *)queue byAccessor:(void (^)(NSError * _Nullable error))accessor API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Synchronous File Coordination ***
 | 
			
		||||
 | 
			
		||||
/* The next four methods behave similarly to -coordinateAccessWithIntents:queue:byAccessor: with one or two NSFileAccessIntent objects with the following exceptions:
 | 
			
		||||
 | 
			
		||||
Each of these methods wait synchronously on the same thread they were invoked on before invoking the passed-in accessor block on the same thread, instead of waiting asynchronously and scheduling invocation of the block on a specific queue.
 | 
			
		||||
 | 
			
		||||
The accessor block of each of these methods is passed one or more URLs that locate the intended items, perhaps changed from the original URLs to take into account the fact that the item might have been moved or renamed during the waiting.
 | 
			
		||||
 
 | 
			
		||||
Each of these methods returns an NSError by reference instead of passing it to the accessory block. However, these methods are uncommon among Cocoa framework methods in that they don't also return a result indicating success or failure. The success of the waiting that they do is typically not interesting to invokers. Only the success of file system access done by the passed-in block is interesting. (The failure of either is of course interesting.) When invoking these methods it's cleanest to just declare a __block variable outside of the block and initialize it to a value that signals failure, and then inside the block set it to a value that signals success. If the waiting fails then the invoked method sets the error reference to an NSError that describes what went wrong, your block will not be invoked, your __block variable will not be set to a value that signals success, and all will be as it should be, with failure signaled and an NSError that describes the failure.
 | 
			
		||||
*/
 | 
			
		||||
- (void)coordinateReadingItemAtURL:(NSURL *)url options:(NSFileCoordinatorReadingOptions)options error:(NSError **)outError byAccessor:(void (NS_NOESCAPE ^)(NSURL *newURL))reader;
 | 
			
		||||
- (void)coordinateWritingItemAtURL:(NSURL *)url options:(NSFileCoordinatorWritingOptions)options error:(NSError **)outError byAccessor:(void (NS_NOESCAPE ^)(NSURL *newURL))writer;
 | 
			
		||||
- (void)coordinateReadingItemAtURL:(NSURL *)readingURL options:(NSFileCoordinatorReadingOptions)readingOptions writingItemAtURL:(NSURL *)writingURL options:(NSFileCoordinatorWritingOptions)writingOptions error:(NSError **)outError byAccessor:(void (NS_NOESCAPE ^)(NSURL *newReadingURL, NSURL *newWritingURL))readerWriter;
 | 
			
		||||
- (void)coordinateWritingItemAtURL:(NSURL *)url1 options:(NSFileCoordinatorWritingOptions)options1 writingItemAtURL:(NSURL *)url2 options:(NSFileCoordinatorWritingOptions)options2 error:(NSError **)outError byAccessor:(void (NS_NOESCAPE ^)(NSURL *newURL1, NSURL *newURL2))writer;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Batched File Coordination ***
 | 
			
		||||
 | 
			
		||||
/* Prepare to more efficiently do a large number of invocations of -coordinate... methods, first synchronously messaging and waiting for NSFilePresenters in a variation of what individual invocations of the -coordinate... methods would do, and then, if no error occurs, invoke the passed-in block. The passed-in block must invoke the completion handler passed to it when all of the coordinated reading and writing it does is done. The completion handler block can be invoked on any thread (or from any dispatch queue, if that's how you think of it). This method returns errors in the same manner as the -coordinate... methods.
 | 
			
		||||
 | 
			
		||||
The -coordinate... methods must use interprocess communication to message instances of NSFileCoordinator and NSFilePresenter in other processes in the system. That is an expense best avoided when reading or writing many files in one operation. Using this method can greatly reduce the amount of interprocess communication required by, for example, a large batched copying or moving of files. You use it by moving all of the invocations of the -coordinate... methods your application will do during a batch operation, or the scheduling of them if the operation's work is done in a multithreaded fashion, into a block and passing that block to an invocation of this method, remembering that the completion handler passed to that block must be invoked when the operation is done. You don't simply pass all URLs that will be passed into invocations of the -coordinate... methods when invoking this method. Instead you pass the top-level files and directories involved in the operation. This method triggers messages to not just NSFilePresenters of those items, but also NSFilePresenters of items contained by those items. For example, when Finder uses this method during a copy operation readingURLs is an array of the URLs of the exact files and folders that the user has selected, even though those folders may contain many files and subfolders for which Finder is going to do coordinated reading, and writingURLs is an array that contains just the URL of the destination folder.
 | 
			
		||||
 | 
			
		||||
In most cases it is redundant to pass the same reading or writing options in an invocation of this method as are passed to individual invocations of the -coordinate... methods invoked by the block passed to an invocation of this method. For example, when Finder invokes this method during a copy operation it does not pass NSFileCoordinatorReadingWithoutChanges because it is appropriate to trigger the saving of document changes right away, but it does pass it when doing the nested invocations of -coordinate... methods because it is not necessary to trigger saving again, even if the user changes the document before the Finder proceeds far enough to actually copy that document's file.
 | 
			
		||||
*/
 | 
			
		||||
- (void)prepareForReadingItemsAtURLs:(NSArray<NSURL *> *)readingURLs options:(NSFileCoordinatorReadingOptions)readingOptions writingItemsAtURLs:(NSArray<NSURL *> *)writingURLs options:(NSFileCoordinatorWritingOptions)writingOptions error:(NSError **)outError byAccessor:(void (NS_NOESCAPE ^)(void (^completionHandler)(void)))batchAccessor;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Renaming and Moving Notification ***
 | 
			
		||||
 | 
			
		||||
/*Announce that the item located by a URL is going to be located by another URL.
 | 
			
		||||
 | 
			
		||||
Support for App Sandbox on OS X. Some applications can rename files while saving them. For example, when a user adds attachments to a rich text document, TextEdit changes the document's extension from .rtf to .rtfd. A sandboxed application like TextEdit must ordinarily prompt the user for approval before renaming a document. You can invoke this method to make your process declare its intent to rename a document without user approval. After the renaming succeeds you must invoke -itemAtURL:didMoveToURL:, with the same arguments, for the process to keep access to the file with its new name and to give up access to any file that appears with the old name. If the renaming fails you should probably not invoke -itemAtURL:didMoveToURL:.
 | 
			
		||||
 | 
			
		||||
There is no reason to invoke this method from applications that do not use App Sandbox. Invoking it does nothing on iOS.
 | 
			
		||||
*/
 | 
			
		||||
- (void)itemAtURL:(NSURL *)oldURL willMoveToURL:(NSURL *)newURL API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Announce that the item located by a URL is now located by another URL.
 | 
			
		||||
 | 
			
		||||
This triggers the sending of messages to NSFilePresenters that implement the corresponding optional methods, even those in other processes, except the one specified when -initWithFilePresenter: was invoked:
 | 
			
		||||
- -presentedItemDidMoveToURL: is sent to NSFilePresenters of the item.
 | 
			
		||||
- If the item is a directory then -presentedItemDidMoveToURL: is sent to NSFilePresenters of each item contained by it.
 | 
			
		||||
- -presentedSubitemAtURL:didMoveToURL: is sent to NSFilePresenters of each directory that contains the item, unless that method is not implemented but -presentedItemDidChange is, and the directory is actually a file package, in which case -presentedItemDidChange is sent instead.
 | 
			
		||||
 | 
			
		||||
This also balances invocations of -itemAtURL:willMoveToURL:, as described above.
 | 
			
		||||
 | 
			
		||||
Useless invocations of this method are harmless, so you don't have to write code that compares NSURLs for equality, which is not straightforward. This method must be invoked from within the block passed to an invocation of -coordinateAccessWithIntents:queue:byAccessory:, -coordinateWritingItemAtURL:options:error:byAccessor:, or -coordinateReadingItemAtURL:options:writingItemAtURL:options:error:byAccessor:.
 | 
			
		||||
*/
 | 
			
		||||
- (void)itemAtURL:(NSURL *)oldURL didMoveToURL:(NSURL *)newURL;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Ubiquity Attribute Change Notification ***
 | 
			
		||||
 | 
			
		||||
/* Announce that the item located by a URL has changed one or more ubiquity attributes. See NSFilePresenter.observedPresentedItemUbiquityAttributes for an explanation of valid attributes.
 | 
			
		||||
 
 | 
			
		||||
This triggers the sending of messages to NSFilePresenters that implement -presentedItemDidChangeUbiquityAttibutes:, even those in other processes.
 | 
			
		||||
*/
 | 
			
		||||
- (void)itemAtURL:(NSURL *)url didChangeUbiquityAttributes:(NSSet <NSURLResourceKey> *)attributes API_AVAILABLE(macos(10.13), ios(11.0)) API_UNAVAILABLE(watchos, tvos);
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Cancellation ***
 | 
			
		||||
 | 
			
		||||
/* Cancel all invocations of -coordinate... and -prepare... methods for the receiver. Any current invocation of one of those methods will stop waiting and return immediately, unless it has already invoked the passed-in block, in which case it will return when the passed-in block returns. Subsequent invocations of those methods will not invoke the blocks passed into them at all. When an invocation of -coordinate... or -prepare... returns without invoking the passed-in block because this method was invoked it instead returns an error whose domain is NSCocoaErrorDomain and whose code is NSUserCancelledError. Messages that have already been sent to NSFilePresenters will not be cancelled but the file coordination machinery will stop waiting for the replies.
 | 
			
		||||
 | 
			
		||||
This method can be invoked from any thread. It always returns immediately, without waiting for anything. Cancellation is racy; you usually cannot assume that no block passed into a -coordinate... or -prepare... method is already being invoked, so the code inside those blocks typically still has to check for cancellation, whatever that means in your application.
 | 
			
		||||
*/
 | 
			
		||||
- (void)cancel;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,174 @@
 | 
			
		||||
/*	NSFileHandle.h
 | 
			
		||||
	Copyright (c) 1995-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSRange.h>
 | 
			
		||||
#import <Foundation/NSException.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
#import <Foundation/NSRunLoop.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSData, NSError;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSFileHandle : NSObject <NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSData *availableData;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithFileDescriptor:(int)fd closeOnDealloc:(BOOL)closeopt NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (nullable NSData *)readDataToEndOfFileAndReturnError:(out NSError **)error
 | 
			
		||||
    API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
- (nullable NSData *)readDataUpToLength:(NSUInteger)length error:(out NSError **)error
 | 
			
		||||
    API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
- (BOOL)writeData:(NSData *)data error:(out NSError **)error
 | 
			
		||||
    API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
- (BOOL)getOffset:(out unsigned long long *)offsetInFile error:(out NSError **)error
 | 
			
		||||
    API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
- (BOOL)seekToEndReturningOffset:(out unsigned long long *_Nullable)offsetInFile error:(out NSError **)error
 | 
			
		||||
    API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
- (BOOL)seekToOffset:(unsigned long long)offset error:(out NSError **)error
 | 
			
		||||
    API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
- (BOOL)truncateAtOffset:(unsigned long long)offset error:(out NSError **)error
 | 
			
		||||
    API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
- (BOOL)synchronizeAndReturnError:(out NSError **)error
 | 
			
		||||
    API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
- (BOOL)closeAndReturnError:(out NSError **)error
 | 
			
		||||
    API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSFileHandle (NSFileHandleCreation)
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSFileHandle *fileHandleWithStandardInput;
 | 
			
		||||
@property (class, readonly, strong) NSFileHandle *fileHandleWithStandardOutput;
 | 
			
		||||
@property (class, readonly, strong) NSFileHandle *fileHandleWithStandardError;
 | 
			
		||||
@property (class, readonly, strong) NSFileHandle *fileHandleWithNullDevice;
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)fileHandleForReadingAtPath:(NSString *)path;
 | 
			
		||||
+ (nullable instancetype)fileHandleForWritingAtPath:(NSString *)path;
 | 
			
		||||
+ (nullable instancetype)fileHandleForUpdatingAtPath:(NSString *)path;
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)fileHandleForReadingFromURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (nullable instancetype)fileHandleForWritingToURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (nullable instancetype)fileHandleForUpdatingURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSFileHandleOperationException;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSFileHandleReadCompletionNotification;
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSFileHandleReadToEndOfFileCompletionNotification;
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSFileHandleConnectionAcceptedNotification;
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSFileHandleDataAvailableNotification;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSFileHandleNotificationDataItem;
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSFileHandleNotificationFileHandleItem;
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSFileHandleNotificationMonitorModes API_DEPRECATED("Not supported", macos(10.0,10.7), ios(2.0,5.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
@interface NSFileHandle (NSFileHandleAsynchronousAccess)
 | 
			
		||||
 | 
			
		||||
- (void)readInBackgroundAndNotifyForModes:(nullable NSArray<NSRunLoopMode> *)modes;
 | 
			
		||||
- (void)readInBackgroundAndNotify;
 | 
			
		||||
 | 
			
		||||
- (void)readToEndOfFileInBackgroundAndNotifyForModes:(nullable NSArray<NSRunLoopMode> *)modes;
 | 
			
		||||
- (void)readToEndOfFileInBackgroundAndNotify;
 | 
			
		||||
 | 
			
		||||
- (void)acceptConnectionInBackgroundAndNotifyForModes:(nullable NSArray<NSRunLoopMode> *)modes;
 | 
			
		||||
- (void)acceptConnectionInBackgroundAndNotify;
 | 
			
		||||
 | 
			
		||||
- (void)waitForDataInBackgroundAndNotifyForModes:(nullable NSArray<NSRunLoopMode> *)modes;
 | 
			
		||||
- (void)waitForDataInBackgroundAndNotify;
 | 
			
		||||
 | 
			
		||||
#ifdef __BLOCKS__
 | 
			
		||||
@property (nullable, copy) void (^readabilityHandler)(NSFileHandle *)  API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (nullable, copy) void (^writeabilityHandler)(NSFileHandle *) API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSFileHandle (NSFileHandlePlatformSpecific)
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithFileDescriptor:(int)fd;
 | 
			
		||||
 | 
			
		||||
@property (readonly) int fileDescriptor;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSFileHandle (/* Deprecations */)
 | 
			
		||||
 | 
			
		||||
/* The API below may throw exceptions and will be deprecated in a future version of the OS.
 | 
			
		||||
 Use their replacements instead. */
 | 
			
		||||
 | 
			
		||||
- (NSData *)readDataToEndOfFile
 | 
			
		||||
    API_DEPRECATED_WITH_REPLACEMENT("readDataToEndOfFileAndReturnError:",
 | 
			
		||||
                                    macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED),
 | 
			
		||||
                                    watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
- (NSData *)readDataOfLength:(NSUInteger)length
 | 
			
		||||
    API_DEPRECATED_WITH_REPLACEMENT("readDataUpToLength:error:",
 | 
			
		||||
                                    macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED),
 | 
			
		||||
                                    watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (void)writeData:(NSData *)data
 | 
			
		||||
    API_DEPRECATED_WITH_REPLACEMENT("writeData:error:",
 | 
			
		||||
                                    macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED),
 | 
			
		||||
                                    watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@property (readonly) unsigned long long offsetInFile
 | 
			
		||||
    API_DEPRECATED_WITH_REPLACEMENT("getOffset:error:",
 | 
			
		||||
                                    macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED),
 | 
			
		||||
                                    watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
- (unsigned long long)seekToEndOfFile
 | 
			
		||||
    API_DEPRECATED_WITH_REPLACEMENT("seekToEndReturningOffset:error:",
 | 
			
		||||
                                    macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED),
 | 
			
		||||
                                    watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
- (void)seekToFileOffset:(unsigned long long)offset
 | 
			
		||||
    API_DEPRECATED_WITH_REPLACEMENT("seekToOffset:error:",
 | 
			
		||||
                                    macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED),
 | 
			
		||||
                                    watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (void)truncateFileAtOffset:(unsigned long long)offset
 | 
			
		||||
    API_DEPRECATED_WITH_REPLACEMENT("truncateAtOffset:error:",
 | 
			
		||||
                                    macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED),
 | 
			
		||||
                                    watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
- (void)synchronizeFile
 | 
			
		||||
    API_DEPRECATED_WITH_REPLACEMENT("synchronizeAndReturnError:",
 | 
			
		||||
                                    macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED),
 | 
			
		||||
                                    watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
- (void)closeFile
 | 
			
		||||
    API_DEPRECATED_WITH_REPLACEMENT("closeAndReturnError:",
 | 
			
		||||
                                    macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED),
 | 
			
		||||
                                    watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSPipe : NSObject
 | 
			
		||||
 | 
			
		||||
@property (readonly, retain) NSFileHandle *fileHandleForReading;
 | 
			
		||||
@property (readonly, retain) NSFileHandle *fileHandleForWriting;
 | 
			
		||||
 | 
			
		||||
+ (NSPipe *)pipe;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,511 @@
 | 
			
		||||
/*	NSFileManager.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSEnumerator.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSPathUtilities.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
#import <Foundation/NSError.h>
 | 
			
		||||
#import <Foundation/NSURL.h>
 | 
			
		||||
#import <CoreFoundation/CFBase.h>
 | 
			
		||||
#import <dispatch/dispatch.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>, NSData, NSDate, NSDirectoryEnumerator<ObjectType>, NSError, NSNumber, NSFileProviderService, NSXPCConnection, NSLock;
 | 
			
		||||
@protocol NSFileManagerDelegate;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSFileAttributeKey NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
typedef NSString * NSFileAttributeType NS_TYPED_ENUM;
 | 
			
		||||
typedef NSString * NSFileProtectionType NS_TYPED_ENUM;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSFileProviderServiceName NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* Version number where NSFileManager can copy/move/enumerate resources forks correctly. 
 | 
			
		||||
*/
 | 
			
		||||
#define NSFoundationVersionWithFileManagerResourceForkSupport 412
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSVolumeEnumerationOptions) {
 | 
			
		||||
    /* The mounted volume enumeration will skip hidden volumes.
 | 
			
		||||
     */
 | 
			
		||||
    NSVolumeEnumerationSkipHiddenVolumes = 1UL << 1,
 | 
			
		||||
    
 | 
			
		||||
    /* The mounted volume enumeration will produce file reference URLs rather than path-based URLs.
 | 
			
		||||
     */
 | 
			
		||||
    NSVolumeEnumerationProduceFileReferenceURLs = 1UL << 2
 | 
			
		||||
} API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDirectoryEnumerationOptions) {
 | 
			
		||||
    /* NSDirectoryEnumerationSkipsSubdirectoryDescendants causes the NSDirectoryEnumerator to perform a shallow enumeration and not descend into directories it encounters.
 | 
			
		||||
     */
 | 
			
		||||
    NSDirectoryEnumerationSkipsSubdirectoryDescendants = 1UL << 0,
 | 
			
		||||
    
 | 
			
		||||
    /* NSDirectoryEnumerationSkipsPackageDescendants will cause the NSDirectoryEnumerator to not descend into packages.
 | 
			
		||||
     */
 | 
			
		||||
    NSDirectoryEnumerationSkipsPackageDescendants      = 1UL << 1,
 | 
			
		||||
    
 | 
			
		||||
    /* NSDirectoryEnumerationSkipsHiddenFiles causes the NSDirectoryEnumerator to not enumerate hidden files.
 | 
			
		||||
     */
 | 
			
		||||
    NSDirectoryEnumerationSkipsHiddenFiles             = 1UL << 2,
 | 
			
		||||
 | 
			
		||||
    /* NSDirectoryEnumerationIncludesDirectoriesPostOrder causes the NSDirectoryEnumerator to enumerate each directory a second time after all of its contained files have been enumerated. Use NSDirectoryEnumerator.isEnumeratingDirectoryPostOrder to differentiate a post-order enumerated directory from a pre-order one.
 | 
			
		||||
     */
 | 
			
		||||
    NSDirectoryEnumerationIncludesDirectoriesPostOrder API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) = 1UL << 3,
 | 
			
		||||
    
 | 
			
		||||
    /* NSDirectoryEnumerationProducesRelativePathURLs causes the NSDirectoryEnumerator to always produce file path URLs relative to the directoryURL. This can reduce the size of each URL object returned during enumeration.
 | 
			
		||||
     */
 | 
			
		||||
    NSDirectoryEnumerationProducesRelativePathURLs API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) = 1UL << 4,
 | 
			
		||||
} API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFileManagerItemReplacementOptions) {
 | 
			
		||||
    /* NSFileManagerItemReplacementUsingNewMetadataOnly causes -replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: to use metadata from the new item only and not to attempt to preserve metadata from the original item.
 | 
			
		||||
     */
 | 
			
		||||
    NSFileManagerItemReplacementUsingNewMetadataOnly = 1UL << 0,
 | 
			
		||||
    
 | 
			
		||||
    /* NSFileManagerItemReplacementWithoutDeletingBackupItem causes -replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: to leave the backup item in place after a successful replacement. The default behavior is to remove the item.
 | 
			
		||||
     */
 | 
			
		||||
     NSFileManagerItemReplacementWithoutDeletingBackupItem = 1UL << 1
 | 
			
		||||
} API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSURLRelationship) {
 | 
			
		||||
    NSURLRelationshipContains,
 | 
			
		||||
    NSURLRelationshipSame,
 | 
			
		||||
    NSURLRelationshipOther
 | 
			
		||||
} API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* NSFileManagerUnmountOptions to pass to unmountVolumeAtURL:options:completionHandler: */
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFileManagerUnmountOptions) {
 | 
			
		||||
    /* If the volume is on a partitioned disk, unmount all volumes on that disk. Then, eject the disk (if it is ejectable).
 | 
			
		||||
     */
 | 
			
		||||
    NSFileManagerUnmountAllPartitionsAndEjectDisk = 1UL << 0,
 | 
			
		||||
    
 | 
			
		||||
    /* Specifies that no UI should accompany the unmount operation. (Otherwise, the unmount UI, if needed, would delay completion of the completionHandler.)
 | 
			
		||||
     */
 | 
			
		||||
    NSFileManagerUnmountWithoutUI = 1UL << 1,
 | 
			
		||||
} API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* If unmountVolumeAtURL:options:completionHandler: fails, the process identifier of the dissenter can be found in the  NSError's userInfo dictionary with this key */
 | 
			
		||||
FOUNDATION_EXPORT NSString *const NSFileManagerUnmountDissentingProcessIdentifierErrorKey API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos); // value is NSNumber containing the process identifier of the dissenter
 | 
			
		||||
 | 
			
		||||
/* Notification sent after the current ubiquity identity has changed.
 | 
			
		||||
*/
 | 
			
		||||
extern NSNotificationName const NSUbiquityIdentityDidChangeNotification API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@interface NSFileManager : NSObject
 | 
			
		||||
 | 
			
		||||
/* Returns the default singleton instance.
 | 
			
		||||
*/
 | 
			
		||||
@property (class, readonly, strong) NSFileManager *defaultManager;
 | 
			
		||||
 | 
			
		||||
/* -mountedVolumeURLsIncludingResourceValuesForKeys:options: returns an NSArray of NSURLs locating the mounted volumes available on the computer. The property keys that can be requested are available in <Foundation/NSURL.h>.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSArray<NSURL *> *)mountedVolumeURLsIncludingResourceValuesForKeys:(nullable NSArray<NSURLResourceKey> *)propertyKeys options:(NSVolumeEnumerationOptions)options API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* This method starts the process of unmounting the volume specified by url. If the volume is encrypted, it is re-locked after being unmounted. The completionHandler will be executed when the operation is complete. If the operation was successful, the block’s errorOrNil argument will be nil; otherwise, errorOrNil will be an error object indicating why the unmount operation failed.
 | 
			
		||||
 */
 | 
			
		||||
- (void)unmountVolumeAtURL:(NSURL *)url options:(NSFileManagerUnmountOptions)mask completionHandler:(void (^)(NSError * _Nullable errorOrNil))completionHandler API_AVAILABLE(macos(10.11)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* -contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error: returns an NSArray of NSURLs identifying the the directory entries. If this method returns nil, an NSError will be returned by reference in the 'error' parameter. If the directory contains no entries, this method will return the empty array. When an array is specified for the 'keys' parameter, the specified property values will be pre-fetched and cached with each enumerated URL.
 | 
			
		||||
 
 | 
			
		||||
    This method always does a shallow enumeration of the specified directory (i.e. it always acts as if NSDirectoryEnumerationSkipsSubdirectoryDescendants has been specified). If you need to perform a deep enumeration, use -[NSFileManager enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:].
 | 
			
		||||
 
 | 
			
		||||
    If you wish to only receive the URLs and no other attributes, then pass '0' for 'options' and an empty NSArray ('[NSArray array]') for 'keys'. If you wish to have the property caches of the vended URLs pre-populated with a default set of attributes, then pass '0' for 'options' and 'nil' for 'keys'.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSArray<NSURL *> *)contentsOfDirectoryAtURL:(NSURL *)url includingPropertiesForKeys:(nullable NSArray<NSURLResourceKey> *)keys options:(NSDirectoryEnumerationOptions)mask error:(NSError **)error API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* -URLsForDirectory:inDomains: is analogous to NSSearchPathForDirectoriesInDomains(), but returns an array of NSURL instances for use with URL-taking APIs. This API is suitable when you need to search for a file or files which may live in one of a variety of locations in the domains specified.
 | 
			
		||||
 */
 | 
			
		||||
- (NSArray<NSURL *> *)URLsForDirectory:(NSSearchPathDirectory)directory inDomains:(NSSearchPathDomainMask)domainMask API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* -URLForDirectory:inDomain:appropriateForURL:create:error: is a URL-based replacement for FSFindFolder(). It allows for the specification and (optional) creation of a specific directory for a particular purpose (e.g. the replacement of a particular item on disk, or a particular Library directory.
 | 
			
		||||
 
 | 
			
		||||
    You may pass only one of the values from the NSSearchPathDomainMask enumeration, and you may not pass NSAllDomainsMask.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSURL *)URLForDirectory:(NSSearchPathDirectory)directory inDomain:(NSSearchPathDomainMask)domain appropriateForURL:(nullable NSURL *)url create:(BOOL)shouldCreate error:(NSError **)error API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Sets 'outRelationship' to NSURLRelationshipContains if the directory at 'directoryURL' directly or indirectly contains the item at 'otherURL', meaning 'directoryURL' is found while enumerating parent URLs starting from 'otherURL'. Sets 'outRelationship' to NSURLRelationshipSame if 'directoryURL' and 'otherURL' locate the same item, meaning they have the same NSURLFileResourceIdentifierKey value. If 'directoryURL' is not a directory, or does not contain 'otherURL' and they do not locate the same file, then sets 'outRelationship' to NSURLRelationshipOther. If an error occurs, returns NO and sets 'error'.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)getRelationship:(NSURLRelationship *)outRelationship ofDirectoryAtURL:(NSURL *)directoryURL toItemAtURL:(NSURL *)otherURL error:(NSError **)error API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Similar to -[NSFileManager getRelationship:ofDirectoryAtURL:toItemAtURL:error:], except that the directory is instead defined by an NSSearchPathDirectory and NSSearchPathDomainMask. Pass 0 for domainMask to instruct the method to automatically choose the domain appropriate for 'url'. For example, to discover if a file is contained by a Trash directory, call [fileManager getRelationship:&result ofDirectory:NSTrashDirectory inDomain:0 toItemAtURL:url error:&error].
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)getRelationship:(NSURLRelationship *)outRelationship ofDirectory:(NSSearchPathDirectory)directory inDomain:(NSSearchPathDomainMask)domainMask toItemAtURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* createDirectoryAtURL:withIntermediateDirectories:attributes:error: creates a directory at the specified URL. If you pass 'NO' for withIntermediateDirectories, the directory must not exist at the time this call is made. Passing 'YES' for withIntermediateDirectories will create any necessary intermediate directories. This method returns YES if all directories specified in 'url' were created and attributes were set. Directories are created with attributes specified by the dictionary passed to 'attributes'. If no dictionary is supplied, directories are created according to the umask of the process. This method returns NO if a failure occurs at any stage of the operation. If an error parameter was provided, a presentable NSError will be returned by reference.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)createDirectoryAtURL:(NSURL *)url withIntermediateDirectories:(BOOL)createIntermediates attributes:(nullable NSDictionary<NSFileAttributeKey, id> *)attributes error:(NSError **)error API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* createSymbolicLinkAtURL:withDestinationURL:error: returns YES if the symbolic link that point at 'destURL' was able to be created at the location specified by 'url'. 'destURL' is always resolved against its base URL, if it has one. If 'destURL' has no base URL and it's 'relativePath' is indeed a relative path, then a relative symlink will be created. If this method returns NO, the link was unable to be created and an NSError will be returned by reference in the 'error' parameter. This method does not traverse a terminal symlink.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)createSymbolicLinkAtURL:(NSURL *)url withDestinationURL:(NSURL *)destURL error:(NSError **)error API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Instances of NSFileManager may now have delegates. Each instance has one delegate, and the delegate is not retained. In versions of Mac OS X prior to 10.5, the behavior of calling [[NSFileManager alloc] init] was undefined. In Mac OS X 10.5 "Leopard" and later, calling [[NSFileManager alloc] init] returns a new instance of an NSFileManager.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, assign) id <NSFileManagerDelegate> delegate API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* setAttributes:ofItemAtPath:error: returns YES when the attributes specified in the 'attributes' dictionary are set successfully on the item specified by 'path'. If this method returns NO, a presentable NSError will be provided by-reference in the 'error' parameter. If no error is required, you may pass 'nil' for the error.
 | 
			
		||||
 
 | 
			
		||||
    This method replaces changeFileAttributes:atPath:.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)setAttributes:(NSDictionary<NSFileAttributeKey, id> *)attributes ofItemAtPath:(NSString *)path error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* createDirectoryAtPath:withIntermediateDirectories:attributes:error: creates a directory at the specified path. If you pass 'NO' for createIntermediates, the directory must not exist at the time this call is made. Passing 'YES' for 'createIntermediates' will create any necessary intermediate directories. This method returns YES if all directories specified in 'path' were created and attributes were set. Directories are created with attributes specified by the dictionary passed to 'attributes'. If no dictionary is supplied, directories are created according to the umask of the process. This method returns NO if a failure occurs at any stage of the operation. If an error parameter was provided, a presentable NSError will be returned by reference.
 | 
			
		||||
 
 | 
			
		||||
    This method replaces createDirectoryAtPath:attributes:
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)createDirectoryAtPath:(NSString *)path withIntermediateDirectories:(BOOL)createIntermediates attributes:(nullable NSDictionary<NSFileAttributeKey, id> *)attributes error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* contentsOfDirectoryAtPath:error: returns an NSArray of NSStrings representing the filenames of the items in the directory. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. If the directory contains no items, this method will return the empty array.
 | 
			
		||||
 
 | 
			
		||||
    This method replaces directoryContentsAtPath:
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSArray<NSString *> *)contentsOfDirectoryAtPath:(NSString *)path error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* subpathsOfDirectoryAtPath:error: returns an NSArray of NSStrings representing the filenames of the items in the specified directory and all its subdirectories recursively. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. If the directory contains no items, this method will return the empty array.
 | 
			
		||||
 
 | 
			
		||||
    This method replaces subpathsAtPath:
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSArray<NSString *> *)subpathsOfDirectoryAtPath:(NSString *)path error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* attributesOfItemAtPath:error: returns an NSDictionary of key/value pairs containing the attributes of the item (file, directory, symlink, etc.) at the path in question. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. This method does not traverse a terminal symlink.
 | 
			
		||||
 
 | 
			
		||||
    This method replaces fileAttributesAtPath:traverseLink:.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSDictionary<NSFileAttributeKey, id> *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* attributesOfFileSystemForPath:error: returns an NSDictionary of key/value pairs containing the attributes of the filesystem containing the provided path. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. This method does not traverse a terminal symlink.
 | 
			
		||||
 
 | 
			
		||||
    This method replaces fileSystemAttributesAtPath:.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSDictionary<NSFileAttributeKey, id> *)attributesOfFileSystemForPath:(NSString *)path error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* createSymbolicLinkAtPath:withDestination:error: returns YES if the symbolic link that point at 'destPath' was able to be created at the location specified by 'path'. If this method returns NO, the link was unable to be created and an NSError will be returned by reference in the 'error' parameter. This method does not traverse a terminal symlink.
 | 
			
		||||
 
 | 
			
		||||
    This method replaces createSymbolicLinkAtPath:pathContent:
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)createSymbolicLinkAtPath:(NSString *)path withDestinationPath:(NSString *)destPath error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* destinationOfSymbolicLinkAtPath:error: returns an NSString containing the path of the item pointed at by the symlink specified by 'path'. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter.
 | 
			
		||||
 
 | 
			
		||||
    This method replaces pathContentOfSymbolicLinkAtPath:
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSString *)destinationOfSymbolicLinkAtPath:(NSString *)path error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* These methods replace their non-error returning counterparts below. See the NSFileManagerDelegate protocol below for methods that are dispatched to the NSFileManager instance's delegate.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)copyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (BOOL)moveItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (BOOL)linkItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (BOOL)removeItemAtPath:(NSString *)path error:(NSError **)error API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* These methods are URL-taking equivalents of the four methods above. Their delegate methods are defined in the NSFileManagerDelegate protocol below.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)copyItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL error:(NSError **)error API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (BOOL)moveItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL error:(NSError **)error API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (BOOL)linkItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL error:(NSError **)error API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (BOOL)removeItemAtURL:(NSURL *)URL error:(NSError **)error API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* trashItemAtURL:resultingItemURL:error: returns YES if the item at 'url' was successfully moved to a Trash. Since the operation may require renaming the file to avoid collisions, it also returns by reference the resulting URL that the item was moved to. If this method returns NO, the item was not moved and an NSError will be returned by reference in the 'error' parameter.
 | 
			
		||||
 | 
			
		||||
    To easily discover if an item is in the Trash, you may use [fileManager getRelationship:&result ofDirectory:NSTrashDirectory inDomain:0 toItemAtURL:url error:&error] && result == NSURLRelationshipContains.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)trashItemAtURL:(NSURL *)url resultingItemURL:(NSURL * _Nullable * _Nullable)outResultingURL error:(NSError **)error API_AVAILABLE(macos(10.8), ios(11.0)) API_UNAVAILABLE(watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* The following methods are deprecated on Mac OS X 10.5. Their URL-based and/or error-returning replacements are listed above.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSDictionary *)fileAttributesAtPath:(NSString *)path traverseLink:(BOOL)yorn API_DEPRECATED("Use -attributesOfItemAtPath:error: instead", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (BOOL)changeFileAttributes:(NSDictionary *)attributes atPath:(NSString *)path API_DEPRECATED("Use -setAttributes:ofItemAtPath:error: instead", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (nullable NSArray *)directoryContentsAtPath:(NSString *)path API_DEPRECATED("Use -contentsOfDirectoryAtPath:error: instead", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (nullable NSDictionary *)fileSystemAttributesAtPath:(NSString *)path API_DEPRECATED("Use -attributesOfFileSystemForPath:error: instead", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (nullable NSString *)pathContentOfSymbolicLinkAtPath:(NSString *)path API_DEPRECATED("Use -destinationOfSymbolicLinkAtPath:error:", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (BOOL)createSymbolicLinkAtPath:(NSString *)path pathContent:(NSString *)otherpath API_DEPRECATED("Use -createSymbolicLinkAtPath:error: instead", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (BOOL)createDirectoryAtPath:(NSString *)path attributes:(NSDictionary *)attributes API_DEPRECATED("Use -createDirectoryAtPath:withIntermediateDirectories:attributes:error: instead", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX || TARGET_OS_MACCATALYST
 | 
			
		||||
- (BOOL)linkPath:(NSString *)src toPath:(NSString *)dest handler:(nullable id)handler API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (BOOL)copyPath:(NSString *)src toPath:(NSString *)dest handler:(nullable id)handler API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (BOOL)movePath:(NSString *)src toPath:(NSString *)dest handler:(nullable id)handler API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (BOOL)removeFileAtPath:(NSString *)path handler:(nullable id)handler API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Process working directory management. Despite the fact that these are instance methods on NSFileManager, these methods report and change (respectively) the working directory for the entire process. Developers are cautioned that doing so is fraught with peril.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly, copy) NSString *currentDirectoryPath;
 | 
			
		||||
- (BOOL)changeCurrentDirectoryPath:(NSString *)path;
 | 
			
		||||
 | 
			
		||||
/* The following methods are of limited utility. Attempting to predicate behavior based on the current state of the filesystem or a particular file on the filesystem is encouraging odd behavior in the face of filesystem race conditions. It's far better to attempt an operation (like loading a file or creating a directory) and handle the error gracefully than it is to try to figure out ahead of time whether the operation will succeed.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)fileExistsAtPath:(NSString *)path;
 | 
			
		||||
- (BOOL)fileExistsAtPath:(NSString *)path isDirectory:(nullable BOOL *)isDirectory;
 | 
			
		||||
- (BOOL)isReadableFileAtPath:(NSString *)path;
 | 
			
		||||
- (BOOL)isWritableFileAtPath:(NSString *)path;
 | 
			
		||||
- (BOOL)isExecutableFileAtPath:(NSString *)path;
 | 
			
		||||
- (BOOL)isDeletableFileAtPath:(NSString *)path;
 | 
			
		||||
 | 
			
		||||
/* -contentsEqualAtPath:andPath: does not take into account data stored in the resource fork or filesystem extended attributes.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)contentsEqualAtPath:(NSString *)path1 andPath:(NSString *)path2;
 | 
			
		||||
 | 
			
		||||
/* displayNameAtPath: returns an NSString suitable for presentation to the user. For directories which have localization information, this will return the appropriate localized string. This string is not suitable for passing to anything that must interact with the filesystem.
 | 
			
		||||
 */
 | 
			
		||||
- (NSString *)displayNameAtPath:(NSString *)path;
 | 
			
		||||
 | 
			
		||||
/* componentsToDisplayForPath: returns an NSArray of display names for the path provided. Localization will occur as in displayNameAtPath: above. This array cannot and should not be reassembled into an usable filesystem path for any kind of access.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSArray<NSString *> *)componentsToDisplayForPath:(NSString *)path;
 | 
			
		||||
 | 
			
		||||
/* enumeratorAtPath: returns an NSDirectoryEnumerator rooted at the provided path. If the enumerator cannot be created, this returns NULL. Because NSDirectoryEnumerator is a subclass of NSEnumerator, the returned object can be used in the for...in construct.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSDirectoryEnumerator<NSString *> *)enumeratorAtPath:(NSString *)path;
 | 
			
		||||
 | 
			
		||||
/* enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: returns an NSDirectoryEnumerator rooted at the provided directory URL. The NSDirectoryEnumerator returns NSURLs from the -nextObject method. The optional 'includingPropertiesForKeys' parameter indicates which resource properties should be pre-fetched and cached with each enumerated URL. The optional 'errorHandler' block argument is invoked when an error occurs. Parameters to the block are the URL on which an error occurred and the error. When the error handler returns YES, enumeration continues if possible. Enumeration stops immediately when the error handler returns NO.
 | 
			
		||||
 | 
			
		||||
    If you wish to only receive the URLs and no other attributes, then pass '0' for 'options' and an empty NSArray ('[NSArray array]') for 'keys'. If you wish to have the property caches of the vended URLs pre-populated with a default set of attributes, then pass '0' for 'options' and 'nil' for 'keys'.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSDirectoryEnumerator<NSURL *> *)enumeratorAtURL:(NSURL *)url includingPropertiesForKeys:(nullable NSArray<NSURLResourceKey> *)keys options:(NSDirectoryEnumerationOptions)mask errorHandler:(nullable BOOL (^)(NSURL *url, NSError *error))handler API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* subpathsAtPath: returns an NSArray of all contents and subpaths recursively from the provided path. This may be very expensive to compute for deep filesystem hierarchies, and should probably be avoided.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSArray<NSString *> *)subpathsAtPath:(NSString *)path;
 | 
			
		||||
 | 
			
		||||
/* These methods are provided here for compatibility. The corresponding methods on NSData which return NSErrors should be regarded as the primary method of creating a file from an NSData or retrieving the contents of a file as an NSData.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSData *)contentsAtPath:(NSString *)path;
 | 
			
		||||
- (BOOL)createFileAtPath:(NSString *)path contents:(nullable NSData *)data attributes:(nullable NSDictionary<NSFileAttributeKey, id> *)attr;
 | 
			
		||||
 | 
			
		||||
/* fileSystemRepresentationWithPath: returns an array of characters suitable for passing to lower-level POSIX style APIs. The string is provided in the representation most appropriate for the filesystem in question.
 | 
			
		||||
 */
 | 
			
		||||
- (const char *)fileSystemRepresentationWithPath:(NSString *)path NS_RETURNS_INNER_POINTER;
 | 
			
		||||
 | 
			
		||||
/* stringWithFileSystemRepresentation:length: returns an NSString created from an array of bytes that are in the filesystem representation.
 | 
			
		||||
 */
 | 
			
		||||
- (NSString *)stringWithFileSystemRepresentation:(const char *)str length:(NSUInteger)len;
 | 
			
		||||
 | 
			
		||||
/* -replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: is for developers who wish to perform a safe-save without using the full NSDocument machinery that is available in the AppKit.
 | 
			
		||||
 
 | 
			
		||||
    The `originalItemURL` is the item being replaced.
 | 
			
		||||
    `newItemURL` is the item which will replace the original item. This item should be placed in a temporary directory as provided by the OS, or in a uniquely named directory placed in the same directory as the original item if the temporary directory is not available.
 | 
			
		||||
    If `backupItemName` is provided, that name will be used to create a backup of the original item. The backup is placed in the same directory as the original item. If an error occurs during the creation of the backup item, the operation will fail. If there is already an item with the same name as the backup item, that item will be removed. The backup item will be removed in the event of success unless the `NSFileManagerItemReplacementWithoutDeletingBackupItem` option is provided in `options`.
 | 
			
		||||
    For `options`, pass `0` to get the default behavior, which uses only the metadata from the new item while adjusting some properties using values from the original item. Pass `NSFileManagerItemReplacementUsingNewMetadataOnly` in order to use all possible metadata from the new item.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)replaceItemAtURL:(NSURL *)originalItemURL withItemAtURL:(NSURL *)newItemURL backupItemName:(nullable NSString *)backupItemName options:(NSFileManagerItemReplacementOptions)options resultingItemURL:(NSURL * _Nullable * _Nullable)resultingURL error:(NSError **)error API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Changes whether the item for the specified URL is ubiquitous and moves the item to the destination URL. When making an item ubiquitous, the destination URL must be prefixed with a URL from -URLForUbiquityContainerIdentifier:. Returns YES if the change is successful, NO otherwise.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)setUbiquitous:(BOOL)flag itemAtURL:(NSURL *)url destinationURL:(NSURL *)destinationURL error:(NSError **)error API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Returns YES if the item for the specified URL is ubiquitous, NO otherwise.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)isUbiquitousItemAtURL:(NSURL *)url API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Start downloading a local instance of the specified ubiquitous item, if necessary. Returns YES if the download started successfully or wasn't necessary, NO otherwise.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)startDownloadingUbiquitousItemAtURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Removes the local instance of the ubiquitous item at the given URL. Returns YES if removal was successful, NO otherwise.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)evictUbiquitousItemAtURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Returns a file URL for the root of the ubiquity container directory corresponding to the supplied container ID. Returns nil if the mobile container does not exist or could not be determined.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSURL *)URLForUbiquityContainerIdentifier:(nullable NSString *)containerIdentifier API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Returns a URL that can be shared with other users to allow them download a copy of the specified ubiquitous item. Also returns the date after which the item will no longer be accessible at the returned URL. The URL must be prefixed with a URL from -URLForUbiquityContainerIdentifier:.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSURL *)URLForPublishingUbiquitousItemAtURL:(NSURL *)url expirationDate:(NSDate * _Nullable * _Nullable)outDate error:(NSError **)error API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Returns an opaque token that represents the current ubiquity identity. This object can be copied, encoded, or compared with isEqual:. When ubiquity containers are unavailable because the user has disabled them, or when the user is simply not logged in, this method will return nil. The NSUbiquityIdentityDidChangeNotification notification is posted after this value changes.
 | 
			
		||||
 | 
			
		||||
    If you don't need the container URL and just want to check if ubiquity containers are available you should use this method instead of checking -URLForUbiquityContainerIdentifier:.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) id<NSObject,NSCopying,NSCoding> ubiquityIdentityToken API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Asynchronously returns a dictionary of zero or more NSFileProviderService instances, which enable your application to instruct the file's provider to take various actions on or with regards to the given URL. To do this, first identify an NSFileProviderService object whose name matches the service you wish to use. Then get an NSXPCConnection from it and set up its NSXPCInterface with the protocol that matches the service's name. You'll need to refer to external documentation or an SDK supplied by the provider to get this information. Once an NSXPCConnection is obtained, you must finish configuring it and send it -resume. Failure to do so will result in leaking system resources.
 | 
			
		||||
 */
 | 
			
		||||
- (void)getFileProviderServicesForItemAtURL:(NSURL *)url completionHandler:(void (^)(NSDictionary <NSFileProviderServiceName, NSFileProviderService *> * _Nullable services, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.13), ios(11.0)) API_UNAVAILABLE(watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* Returns the container directory associated with the specified security application group ID.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSURL *)containerURLForSecurityApplicationGroupIdentifier:(NSString *)groupIdentifier API_AVAILABLE(macos(10.8), ios(7.0), watchos(2.0), tvos(9.0)); // Available for OS X in 10.8.3.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSFileManager (NSUserInformation)
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSURL *homeDirectoryForCurrentUser API_AVAILABLE(macosx(10.12)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
@property (readonly, copy) NSURL *temporaryDirectory API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
- (nullable NSURL *)homeDirectoryForUser:(NSString *)userName API_AVAILABLE(macosx(10.12)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* These delegate methods are for the use of the deprecated handler-taking methods on NSFileManager for copying, moving, linking or deleting files.
 | 
			
		||||
 */
 | 
			
		||||
@interface NSObject (NSCopyLinkMoveHandler)
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fm shouldProceedAfterError:(NSDictionary *)errorInfo API_DEPRECATED(" Handler API no longer supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (void)fileManager:(NSFileManager *)fm willProcessPath:(NSString *)path API_DEPRECATED("Handler API no longer supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@protocol NSFileManagerDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* fileManager:shouldCopyItemAtPath:toPath: gives the delegate an opportunity to filter the resulting copy. Returning YES from this method will allow the copy to happen. Returning NO from this method causes the item in question to be skipped. If the item skipped was a directory, no children of that directory will be copied, nor will the delegate be notified of those children.
 | 
			
		||||
 | 
			
		||||
    If the delegate does not implement this method, the NSFileManager instance acts as if this method returned YES.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldCopyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath;
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldCopyItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* fileManager:shouldProceedAfterError:copyingItemAtPath:toPath: gives the delegate an opportunity to recover from or continue copying after an error. If an error occurs, the error object will contain an NSError indicating the problem. The source path and destination paths are also provided. If this method returns YES, the NSFileManager instance will continue as if the error had not occurred. If this method returns NO, the NSFileManager instance will stop copying, return NO from copyItemAtPath:toPath:error: and the error will be provied there.
 | 
			
		||||
 | 
			
		||||
    If the delegate does not implement this method, the NSFileManager instance acts as if this method returned NO.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error copyingItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath;
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error copyingItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* fileManager:shouldMoveItemAtPath:toPath: gives the delegate an opportunity to not move the item at the specified path. If the source path and the destination path are not on the same device, a copy is performed to the destination path and the original is removed. If the copy does not succeed, an error is returned and the incomplete copy is removed, leaving the original in place.
 | 
			
		||||
 | 
			
		||||
    If the delegate does not implement this method, the NSFileManager instance acts as if this method returned YES.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldMoveItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath;
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldMoveItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* fileManager:shouldProceedAfterError:movingItemAtPath:toPath: functions much like fileManager:shouldProceedAfterError:copyingItemAtPath:toPath: above. The delegate has the opportunity to remedy the error condition and allow the move to continue.
 | 
			
		||||
 | 
			
		||||
    If the delegate does not implement this method, the NSFileManager instance acts as if this method returned NO.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error movingItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath;
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error movingItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* fileManager:shouldLinkItemAtPath:toPath: acts as the other "should" methods, but this applies to the file manager creating hard links to the files in question.
 | 
			
		||||
 | 
			
		||||
    If the delegate does not implement this method, the NSFileManager instance acts as if this method returned YES.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldLinkItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath;
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldLinkItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* fileManager:shouldProceedAfterError:linkingItemAtPath:toPath: allows the delegate an opportunity to remedy the error which occurred in linking srcPath to dstPath. If the delegate returns YES from this method, the linking will continue. If the delegate returns NO from this method, the linking operation will stop and the error will be returned via linkItemAtPath:toPath:error:.
 | 
			
		||||
 | 
			
		||||
    If the delegate does not implement this method, the NSFileManager instance acts as if this method returned NO.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error linkingItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath;
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error linkingItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* fileManager:shouldRemoveItemAtPath: allows the delegate the opportunity to not remove the item at path. If the delegate returns YES from this method, the NSFileManager instance will attempt to remove the item. If the delegate returns NO from this method, the remove skips the item. If the item is a directory, no children of that item will be visited.
 | 
			
		||||
 | 
			
		||||
    If the delegate does not implement this method, the NSFileManager instance acts as if this method returned YES.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldRemoveItemAtPath:(NSString *)path;
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldRemoveItemAtURL:(NSURL *)URL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* fileManager:shouldProceedAfterError:removingItemAtPath: allows the delegate an opportunity to remedy the error which occurred in removing the item at the path provided. If the delegate returns YES from this method, the removal operation will continue. If the delegate returns NO from this method, the removal operation will stop and the error will be returned via linkItemAtPath:toPath:error:.
 | 
			
		||||
 | 
			
		||||
    If the delegate does not implement this method, the NSFileManager instance acts as if this method returned NO.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error removingItemAtPath:(NSString *)path;
 | 
			
		||||
- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error removingItemAtURL:(NSURL *)URL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSDirectoryEnumerator<ObjectType> : NSEnumerator<ObjectType>
 | 
			
		||||
 | 
			
		||||
/* For NSDirectoryEnumerators created with -enumeratorAtPath:, the -fileAttributes and -directoryAttributes methods return an NSDictionary containing the keys listed below. For NSDirectoryEnumerators created with -enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:, these two methods return nil.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, readonly, copy) NSDictionary<NSFileAttributeKey, id> *fileAttributes;
 | 
			
		||||
@property (nullable, readonly, copy) NSDictionary<NSFileAttributeKey, id> *directoryAttributes;
 | 
			
		||||
 | 
			
		||||
/* For NSDirectoryEnumerators created with -enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: and the NSDirectoryEnumerationIncludesDirectoriesPostOrder option, this property is YES when the current object is a directory that is being enumerated after all of its contents have been enumerated.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) BOOL isEnumeratingDirectoryPostOrder API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
- (void)skipDescendents;
 | 
			
		||||
 | 
			
		||||
/* This method returns the number of levels deep the current object is in the directory hierarchy being enumerated. The directory passed to -enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: is considered to be level 0.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) NSUInteger level API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* This method is spelled correctly.
 | 
			
		||||
 */
 | 
			
		||||
- (void)skipDescendants API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* In an application that has received a URL to a file owned by a file provider, instances of NSFileProviderService can by obtained by calling -[NSFileManager getFileProviderServicesForItemAtURL:completionHandler:]. Each NSFileProviderService instance can only be used to operate on the URL originally passed to that method.
 | 
			
		||||
 */
 | 
			
		||||
API_AVAILABLE(macos(10.13), ios(11.0)) API_UNAVAILABLE(watchos, tvos)
 | 
			
		||||
@interface NSFileProviderService : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    NSFileProviderServiceName _name;
 | 
			
		||||
    id _endpointCreatingProxy;
 | 
			
		||||
    dispatch_group_t _requestFinishedGroup;
 | 
			
		||||
}
 | 
			
		||||
- (void)getFileProviderConnectionWithCompletionHandler:(void (^)(NSXPCConnection * _Nullable connection, NSError * _Nullable error))completionHandler;
 | 
			
		||||
@property (readonly, copy) NSFileProviderServiceName name;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileType;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeType const NSFileTypeDirectory;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeType const NSFileTypeRegular;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeType const NSFileTypeSymbolicLink;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeType const NSFileTypeSocket;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeType const NSFileTypeCharacterSpecial;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeType const NSFileTypeBlockSpecial;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeType const NSFileTypeUnknown;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileSize;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileModificationDate;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileReferenceCount;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileDeviceIdentifier;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileOwnerAccountName;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileGroupOwnerAccountName;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFilePosixPermissions;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileSystemNumber;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileSystemFileNumber;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileExtensionHidden;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileHFSCreatorCode;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileHFSTypeCode;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileImmutable;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileAppendOnly;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileCreationDate;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileOwnerAccountID;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileGroupOwnerAccountID;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileBusy;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileProtectionKey API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSFileProtectionType const NSFileProtectionNone API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSFileProtectionType const NSFileProtectionComplete API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSFileProtectionType const NSFileProtectionCompleteUnlessOpen API_AVAILABLE(macos(10.6), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSFileProtectionType const NSFileProtectionCompleteUntilFirstUserAuthentication API_AVAILABLE(macos(10.6), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileSystemSize;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileSystemFreeSize;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileSystemNodes;
 | 
			
		||||
FOUNDATION_EXPORT NSFileAttributeKey const NSFileSystemFreeNodes;
 | 
			
		||||
 | 
			
		||||
@interface NSDictionary<KeyType, ObjectType> (NSFileAttributes)
 | 
			
		||||
 | 
			
		||||
- (unsigned long long)fileSize;
 | 
			
		||||
- (nullable NSDate *)fileModificationDate;
 | 
			
		||||
- (nullable NSString *)fileType;
 | 
			
		||||
- (NSUInteger)filePosixPermissions;
 | 
			
		||||
- (nullable NSString *)fileOwnerAccountName;
 | 
			
		||||
- (nullable NSString *)fileGroupOwnerAccountName;
 | 
			
		||||
- (NSInteger)fileSystemNumber;
 | 
			
		||||
- (NSUInteger)fileSystemFileNumber;
 | 
			
		||||
- (BOOL)fileExtensionHidden;
 | 
			
		||||
- (OSType)fileHFSCreatorCode;
 | 
			
		||||
- (OSType)fileHFSTypeCode;
 | 
			
		||||
- (BOOL)fileIsImmutable;
 | 
			
		||||
- (BOOL)fileIsAppendOnly;
 | 
			
		||||
- (nullable NSDate *)fileCreationDate;
 | 
			
		||||
- (nullable NSNumber *)fileOwnerAccountID;
 | 
			
		||||
- (nullable NSNumber *)fileGroupOwnerAccountID;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,152 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFilePresenter.h
 | 
			
		||||
	Copyright (c) 2010-2019, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSURL.h>
 | 
			
		||||
 | 
			
		||||
@class NSError, NSFileVersion, NSOperationQueue, NSSet<ObjectType>;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* A protocol to be implemented by objects that present the contents of files or directories to the user for viewing or editing. The objects can take an active role in operations that access those files or directories, even operations performed by other processes in the system. For an NSFilePresenter to be aware of such file access it must be "coordinated" file access. The NSFileCoordinator class that is used to do coordinated file access is declared in <Foundation/NSFileCoordinator.h>. Starting in version 10.7 many components of Mac OS X use NSFileCoordinator, including AppKit, Finder, and various applications. NSDocument conforms to the NSFilePresenter protocol and has useful implementations of all of its methods. You are unlikely to have to implement NSFilePresenter yourself in an NSDocument-based application.
 | 
			
		||||
 | 
			
		||||
See the comments for -[NSFileCoordinator initWithFilePresenter:] for information about how an NSFilePresenter can avoid receiving messages about its own reading and writing.
 | 
			
		||||
 | 
			
		||||
You can consider "item" in method names in this header file to be an abbreviation of "fileOrDirectory." As always, a directory might actually be a file package.
 | 
			
		||||
*/
 | 
			
		||||
@protocol NSFilePresenter<NSObject>
 | 
			
		||||
 | 
			
		||||
@required
 | 
			
		||||
 | 
			
		||||
/* The NSURL that locates the file or directory that the receiver is presenting to the user. Implementations of this method must be prepared to be invoked by Cocoa in any queue, at any time, including from within invocations of NSFileCoordinator methods. A nil value is valid and means that the presented item does not exist yet. An NSFilePresenter with a nil presentedItemURL will be asked for its presentedItemURL again when coordinated file access on behalf of that NSFilePresenter completes, in case the presented item was just created.
 | 
			
		||||
 | 
			
		||||
For example, NSDocument has a -presentedItemURL method that usually returns [self fileURL]. In a shoebox application that stores the user's data in files somewhere on the user's computer you can implement this method to specify the directory that contains those files.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *presentedItemURL;
 | 
			
		||||
 | 
			
		||||
/* The operation queue in which all of the other NSFilePresenter messages except -presentedItemURL will be sent to the receiver. Implementations of this method must be prepared to be invoked by Cocoa in any queue, at any time, including from within invocations of NSFileCoordinator methods. A nil value is not valid.
 | 
			
		||||
 | 
			
		||||
For example, NSDocument has a -presentedItemOperationQueue method that returns a private queue. In very simple cases you can return [NSOperationQueue mainQueue], but doing so is often an invitation to deadlocks.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, retain) NSOperationQueue *presentedItemOperationQueue;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* Support for App Sandbox on OS X. Some applications, given a user-selected file, require access to additional files or directories with related names. For example, a movie player might have to automatically load subtitles for a movie that the user opened. By convention, the subtitle file has the same name as the movie, but a different file extension. If the movie player is sandboxed, its use of NSOpenPanel will grant it access to the user-selected movie (the primary item). However, access to the subtitle file (the secondary item) will not be granted by NSOpenPanel. To get access to a secondary item, a process can register an NSFilePresenter for it and unregister the NSFilePresenter once the application is finished accessing it. Each NSFilePresenter of a secondary item must return an NSURL to the primary item on request. You make that happen by providing an implementation of -primaryPresentedItemURL that returns an NSURL for the primary item.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *primaryPresentedItemURL API_AVAILABLE(macos(10.8)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* Given that something in the system is waiting to read from the presented file or directory, do whatever it takes to ensure that the application will behave properly while that reading is happening, and then invoke the completion handler. The definition of "properly" depends on what kind of ownership model the application implements. Implementations of this method must always invoke the passed-in reader block because other parts of the system will wait until it is invoked or until the user loses patience and cancels the waiting. When an implementation of this method invokes the passed-in block it can pass that block yet another block, which will be invoked in the receiver's operation queue when reading is complete.
 | 
			
		||||
 | 
			
		||||
A common sequence that your NSFilePresenter must handle is the file coordination mechanism sending this message, then sending -savePresentedItemChangesWithCompletionHandler:, and then, after you have invoked that completion handler, invoking your reacquirer.
 | 
			
		||||
*/
 | 
			
		||||
- (void)relinquishPresentedItemToReader:(void (^)(void (^ _Nullable reacquirer)(void)))reader;
 | 
			
		||||
 | 
			
		||||
/* Given that something in the system is waiting to write to the presented file or directory, do whatever it takes to ensure that the application will behave properly while that writing is happening, and then invoke the completion handler. The definition of "properly" depends on what kind of ownership model the application implements. Implementations of this method must always invoke the passed-in writer block because other parts of the system will wait until it is invoked or until the user loses patience and cancels the waiting. When an implementation of this method invokes the passed-in block it can pass that block yet another block, which will be invoked in the receiver's operation queue when writing is complete.
 | 
			
		||||
 | 
			
		||||
A common sequence that your NSFilePresenter must handle is the file coordination mechanism sending this message, then sending -accommodatePresentedItemDeletionWithCompletionHandler: or -savePresentedItemChangesWithCompletionHandler:, and then, after you have invoked that completion handler, invoking your reacquirer. It is also common for your NSFilePresenter to be sent a combination of the -presented... messages listed below in between relinquishing and reacquiring.
 | 
			
		||||
*/
 | 
			
		||||
- (void)relinquishPresentedItemToWriter:(void (^)(void (^ _Nullable reacquirer)(void)))writer;
 | 
			
		||||
 | 
			
		||||
/* Given that something in the system is waiting to read from the presented file or directory, do whatever it takes to ensure that the contents of the presented file or directory is completely up to date, and then invoke the completion handler. If successful (including when there is simply nothing to do) pass nil to the completion handler, or if not successful pass an NSError that encapsulates the reason why saving failed. Implementations of this method must always invoke the completion handler because other parts of the system will wait until it is invoked or the user loses patience and cancels the waiting. If this method is not implemented then the NSFilePresenter is assumed to be one that never lets the user make changes that need to be saved.
 | 
			
		||||
 | 
			
		||||
For example, NSDocument has an implementation of this method that autosaves the document if it has been changed since the last time it was saved or autosaved. That way when another process tries to read the document file it always reads the same version of the document that the user is looking at in your application. (WYSIWGCBF - What You See Is What Gets Copied By Finder.) A shoebox application would also implement this method.
 | 
			
		||||
 | 
			
		||||
The file coordination mechanism does not always send -relinquishPresentedItemToReader: or -relinquishPresentedItemToWriter: to your NSFilePresenter before sending this message. For example, other process' use of -[NSFileCoordinator prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:] can cause this to happen.
 | 
			
		||||
*/
 | 
			
		||||
- (void)savePresentedItemChangesWithCompletionHandler:(void (^)(NSError * _Nullable errorOrNil))completionHandler;
 | 
			
		||||
 | 
			
		||||
/* Given that something in the system is waiting to delete the presented file or directory, do whatever it takes to ensure that the deleting will succeed and that the receiver's application will behave properly when the deleting has happened, and then invoke the completion handler. If successful (including when there is simply nothing to do) pass nil to the completion handler, or if not successful pass an NSError that encapsulates the reason why preparation failed. 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.
 | 
			
		||||
 | 
			
		||||
For example, NSDocument has an implementation of this method that closes the document. That way if the document is in the trash and the user empties the trash the document is simply closed before its file is deleted. This means that emptying the trash will not fail with an alert about the file being "in use" just because the document's file is memory mapped by the application. It also means that the document won't be left open with no document file underneath it. A shoebox application would only implement this method to be robust against surprising things like the user deleting its data directory while the application is running.
 | 
			
		||||
 | 
			
		||||
The file coordination mechanism does not always send -relinquishPresentedItemToReader: or -relinquishPresentedItemToWriter: to your NSFilePresenter before sending this message. For example, other process' use of -[NSFileCoordinator prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:] can cause this to happen.
 | 
			
		||||
*/
 | 
			
		||||
- (void)accommodatePresentedItemDeletionWithCompletionHandler:(void (^)(NSError * _Nullable errorOrNil))completionHandler;
 | 
			
		||||
 | 
			
		||||
/* 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.
 | 
			
		||||
 | 
			
		||||
For example, NSDocument implements this method to handle document file moving and renaming. A shoebox application would only implement this method to be robust against surprising things like the user moving its data directory while the application is running.
 | 
			
		||||
 | 
			
		||||
Not all programs use file coordination. Your NSFileProvider may be sent this message without being sent -relinquishPresentedItemToWriter: first. Make your application do the best it can in that case.
 | 
			
		||||
*/
 | 
			
		||||
- (void)presentedItemDidMoveToURL:(NSURL *)newURL;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Files and File Packages ***
 | 
			
		||||
 | 
			
		||||
/* These messages are sent by the file coordination machinery only when the presented item is a file or file package.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Be notified that the file or file package's contents or attributes have been been written to. Because this method may be be invoked when the attributes have changed but the contents have not, implementations that read the contents must use modification date checking to avoid needless rereading. They should check that the modification date has changed since the receiver most recently read from or wrote to the item. To avoid race conditions, getting the modification date should typically be done within invocations of one of the -[NSFileCoordinator coordinate...] methods.
 | 
			
		||||
 | 
			
		||||
For example, NSDocument implements this method to react to both contents changes (like the user overwriting the document file with another application) and attribute changes (like the user toggling the "Hide extension" checkbox in a Finder info panel). It uses modification date checking as described above.
 | 
			
		||||
 | 
			
		||||
Not all programs use file coordination. Your NSFileProvider may be sent this message without being sent -relinquishPresentedItemToWriter: first. Make your application do the best it can in that case.
 | 
			
		||||
*/
 | 
			
		||||
- (void)presentedItemDidChange;
 | 
			
		||||
 | 
			
		||||
/* Be notified that the presented file or file package's ubiquity attributes have changed. The possible attributes that can appear in the given set include only those specified by the receiver's value for observedPresentedItemUbiquityAttributes, or those in the default set if that property is not implemented.
 | 
			
		||||
 
 | 
			
		||||
Note that changes to these attributes do not normally align with -presentedItemDidChange notifications.
 | 
			
		||||
*/
 | 
			
		||||
- (void)presentedItemDidChangeUbiquityAttributes:(NSSet<NSURLResourceKey> *)attributes API_AVAILABLE(macos(10.13), ios(11.0)) API_UNAVAILABLE(watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* The set of ubiquity attributes, which the receiver wishes to be notified about when they change for presentedItemURL. Valid attributes include only NSURLIsUbiquitousItemKey and any other attributes whose names start with "NSURLUbiquitousItem" or "NSURLUbiquitousSharedItem". The default set, in case this property is not implemented, includes of all such attributes.
 | 
			
		||||
 
 | 
			
		||||
This property will normally be checked only at the time addFilePresenter: is called. However, if presentedItemURL is nil at that time, it will instead be checked only at the end of a coordinated write where presentedItemURL became non-nil. The value of this property should not change depending on whether presentedItemURL is currently ubiquitous or is located a ubiquity container.
 | 
			
		||||
 
 | 
			
		||||
For example, NSDocument implements this property to always return NSURLIsUbiquitousItemKey, NSURLUbiquitousItemIsSharedKey, and various other properties starting with "NSURLUbiquitousSharedItem". It needsto be notified about changes to these properties in order to implement support for ubiquitous and shared documents.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, strong) NSSet<NSURLResourceKey> *observedPresentedItemUbiquityAttributes API_AVAILABLE(macos(10.13), ios(11.0)) API_UNAVAILABLE(watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* Be notified that something in the system has added, removed, or resolved a version of the file or file package.
 | 
			
		||||
 | 
			
		||||
For example, NSDocument has implementations of these methods that help decide whether to present a versions browser when it has reacquired after relinquishing to a writer, and to react to versions being added and removed while it is presenting the versions browser.
 | 
			
		||||
*/
 | 
			
		||||
- (void)presentedItemDidGainVersion:(NSFileVersion *)version;
 | 
			
		||||
- (void)presentedItemDidLoseVersion:(NSFileVersion *)version;
 | 
			
		||||
- (void)presentedItemDidResolveConflictVersion:(NSFileVersion *)version;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Directories ***
 | 
			
		||||
 | 
			
		||||
/* These methods are sent by the file coordination machinery only when the presented item is a directory. "Contained by the directory" in these comments means contained by the directory, a directory contained by the directory, and so on.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Given that something in the system is waiting to delete a file or directory contained by the directory, do whatever it takes to ensure that the deleting will succeed and that the receiver's application will behave properly when the deleting has happened, and then invoke the completion handler. If successful (including when there is simply nothing to do) pass nil to the completion handler, or if not successful pass an NSError that encapsulates the reason why preparation failed. 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.
 | 
			
		||||
 | 
			
		||||
The file coordination mechanism does not always send -relinquishPresentedItemToReader: or -relinquishPresentedItemToWriter: to your NSFilePresenter before sending this message. For example, other process' use of -[NSFileCoordinator prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:] can cause this to happen.
 | 
			
		||||
*/
 | 
			
		||||
- (void)accommodatePresentedSubitemDeletionAtURL:(NSURL *)url completionHandler:(void (^)(NSError * _Nullable errorOrNil))completionHandler;
 | 
			
		||||
 | 
			
		||||
/* Be notified that a file or directory contained by the directory has been added. If this method is not implemented but -presentedItemDidChange is, and the directory is actually a file package, then the file coordination machinery will invoke -presentedItemDidChange instead.
 | 
			
		||||
 | 
			
		||||
Not all programs use file coordination. Your NSFileProvider may be sent this message without being sent -relinquishPresentedItemToWriter: first. Make your application do the best it can in that case.
 | 
			
		||||
*/
 | 
			
		||||
- (void)presentedSubitemDidAppearAtURL:(NSURL *)url;
 | 
			
		||||
 | 
			
		||||
/* Be notified that a file or directory contained by the directory has been moved or renamed. If this method is not implemented but -presentedItemDidChange is, and the directory is actually a file package, then the file coordination machinery will invoke -presentedItemDidChange instead.
 | 
			
		||||
 | 
			
		||||
Not all programs use file coordination. Your NSFileProvider may be sent this message without being sent -relinquishPresentedItemToWriter: first. Make your application do the best it can in that case.
 | 
			
		||||
*/
 | 
			
		||||
- (void)presentedSubitemAtURL:(NSURL *)oldURL didMoveToURL:(NSURL *)newURL;
 | 
			
		||||
 | 
			
		||||
/* Be notified that the contents or attributes of a file or directory contained by the directory have been been written to. Depending on the situation the advice given for -presentedItemDidChange may apply here too. If this method is not implemented but -presentedItemDidChange is, and the directory is actually a file package, then the file coordination machinery will invoke -presentedItemDidChange instead.
 | 
			
		||||
 | 
			
		||||
Not all programs use file coordination. Your NSFileProvider may be sent this message without being sent -relinquishPresentedItemToWriter: first. Make your application do the best it can in that case.
 | 
			
		||||
*/
 | 
			
		||||
- (void)presentedSubitemDidChangeAtURL:(NSURL *)url;
 | 
			
		||||
 | 
			
		||||
/* Be notified that the something in the system has added, removed, or resolved a version of a file or directory contained by the directory.
 | 
			
		||||
*/
 | 
			
		||||
- (void)presentedSubitemAtURL:(NSURL *)url didGainVersion:(NSFileVersion *)version;
 | 
			
		||||
- (void)presentedSubitemAtURL:(NSURL *)url didLoseVersion:(NSFileVersion *)version;
 | 
			
		||||
- (void)presentedSubitemAtURL:(NSURL *)url didResolveConflictVersion:(NSFileVersion *)version;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,163 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFileVersion.h
 | 
			
		||||
	Copyright (c) 2010-2019, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>, NSDate, NSDictionary, NSError, NSString, NSURL, NSPersonNameComponents;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFileVersionAddingOptions) {
 | 
			
		||||
 | 
			
		||||
    /* Whether +addVersionOfItemAtURL:withContentsOfURL:options:error: can move the new version contents file into the version store instead of copying it. Moving is much faster. See the comment for -temporaryDirectoryURLForNewVersionOfItemAtURL: for an example of when this useful.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileVersionAddingByMoving = 1 << 0
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFileVersionReplacingOptions) {
 | 
			
		||||
 | 
			
		||||
    /* Whether -replaceItemAtURL:options:error: must move the version's contents out of the version store instead of copying it. This is useful when you want to promote a version's contents to a separate file. You wouldn't use this to restore a version of a file.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileVersionReplacingByMoving = 1 << 0
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Instances of NSFileVersion for the same version of the same file are equal, and instances of NSFileVersion for different versions of the same file are not equal, but the equality of NSFileVersions for different files is undefined. Repeated invocations of the methods that return NSFileVersions do not necessarily return the exact same instance of NSFileVersion.
 | 
			
		||||
*/
 | 
			
		||||
API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSFileVersion : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    NSURL *_fileURL;
 | 
			
		||||
    id _addition;
 | 
			
		||||
    id _deadVersionIdentifier;
 | 
			
		||||
    id _nonLocalVersion;
 | 
			
		||||
    NSURL *_contentsURL;
 | 
			
		||||
    BOOL _isBackup;
 | 
			
		||||
    NSString *_localizedName;
 | 
			
		||||
    NSString *_localizedComputerName;
 | 
			
		||||
    NSDate *_modificationDate;
 | 
			
		||||
    BOOL _isResolved;
 | 
			
		||||
    BOOL _contentsURLIsAccessed;
 | 
			
		||||
    id _reserved;
 | 
			
		||||
    NSString *_name;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Return an NSFileVersion that represents the contents of the file located by a URL, or nil if there is no such file.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSFileVersion *)currentVersionOfItemAtURL:(NSURL *)url;
 | 
			
		||||
 | 
			
		||||
/* Return an array of NSFileVersions associated with the file located by a URL, or nil if there is no such file. The array never contains an NSFileVersion equal to what +currentVersionOfItemAtURL: would return.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSArray<NSFileVersion *> *)otherVersionsOfItemAtURL:(NSURL *)url;
 | 
			
		||||
 | 
			
		||||
/* Return an array of NSFileVersions that represent unresolved conflicts for the file located by a URL, or nil if there is no such file.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSArray<NSFileVersion *> *)unresolvedConflictVersionsOfItemAtURL:(NSURL *)url;
 | 
			
		||||
 | 
			
		||||
/* Asynchronously return an array of NSFileVersions associated with the file located by the given URL, or nil if there is no such file or another error occurs. Versions returned by this method do not initially have their contents stored locally on the device, so a download may be required before you are able to access them. File attributes are accessible via -[NSURL getPromisedItemResourceValue:forKey:error:]. You can request a download by performing a coordinated read with NSFileCoordinator on the URL property of the resulting NSFileVersions.
 | 
			
		||||
 
 | 
			
		||||
When a version is successfully downloaded, its contents are cached locally, and the version will no longer be returned by this method. The version will be returned by +[NSFileVersion otherVersionsOfItemAtURL:] instead, but will retain the same persistentIdentifier value. If the local version is later discarded, future invocations of this method may resume returning the version.
 | 
			
		||||
 
 | 
			
		||||
If you need to get all versions for a document, both local and non-local, you should use an NSFilePresenter that implements -presentedItemDidGainVersion: and -presentedItemDidLoseVersion: and invoke +[NSFileCoordinator addFilePresenter:], +[NSFileVersion otherVersionsOfItemAtURL:], and this method within a single coordinated read.
 | 
			
		||||
*/
 | 
			
		||||
+ (void)getNonlocalVersionsOfItemAtURL:(NSURL *)url completionHandler:(void (^)(NSArray<NSFileVersion *> * _Nullable nonlocalFileVersions, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* For a file located by a URL, return the NSFileVersion identified by a persistent identifier of the sort returned by -persistentIdentifier, or nil if the version no longer exists.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSFileVersion *)versionOfItemAtURL:(NSURL *)url forPersistentIdentifier:(id)persistentIdentifier;
 | 
			
		||||
 | 
			
		||||
/* Add a new version of the file located by a URL, with the contents coming from a file located by either the same or a different URL, and return a new instance that represents the version if successful. If not successful, return NO after setting *outError to an NSError that encapsulates why not.
 | 
			
		||||
 | 
			
		||||
You can add versions only on Mac OS X.
 | 
			
		||||
 | 
			
		||||
When adding or removing versions of a file you should do it as part of a "coordinated" write to the file. The NSFileCoordinator class that you use to do coordinated file access is declared in <Foundation/NSFileCoordinator.h>. Using it properly ensures that NSFilePresenters of the file, or directories that contain the file, receive accurate notifications about versions being added or removed. NSFilePresenter is declared in <Foundation/NSFilePresenter.h>. For example, use -[NSFileCoordinator coordinateWritingItemAtURL:options:error:byAccessor:] when the file URL and the contents url are the same. (NSFileVersion doesn't simply use NSFileCoordinator itself because that would be insufficient when the adding or removing of versions is part of a larger operation that should be treated as one coordinated file access.)
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSFileVersion *)addVersionOfItemAtURL:(NSURL *)url withContentsOfURL:(NSURL *)contentsURL options:(NSFileVersionAddingOptions)options error:(NSError **)outError API_AVAILABLE(macos(10.7)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* Given a URL, create a new directory that is suitable for using as the container of a new temporary file that you will create and use with NSFileVersionAddingByMoving. This is useful when you want to create a new version of a file out of something other than the file's current contents, for example, the contents in memory of a document that has not yet been saved to its file. You must remove this directory when you are done with it, using -[NSFileManager removeItemAtURL:error:] for example.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSURL *)temporaryDirectoryURLForNewVersionOfItemAtURL:(NSURL *)url API_AVAILABLE(macos(10.7)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* The location of the receiver's storage, or possibly nil if the receiver's storage has been deleted. The storage is read-only. The URL will have an arcane path. You must not derive user-presentable text from it.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSURL *URL;
 | 
			
		||||
 | 
			
		||||
/* The user-presentable name of the version, or possibly nil if the receiver's storage has been deleted. This will be different from the user-presentable name of the versioned file if, for example, the file has been renamed since the version was added.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *localizedName;
 | 
			
		||||
 | 
			
		||||
/* The user-presentable name of the computer on which the version was saved, or possibly nil if the receiver's storage has been deleted, or nil if no computer name was recorded. The computer name is guaranteed to have been recorded only if the version is a conflict version. This will be different from that computer's current name if the computer's name has been changed since the version was retrieved from that computer.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *localizedNameOfSavingComputer;
 | 
			
		||||
 | 
			
		||||
/* The name components of the user who created this version of the file. Is nil if the file is not shared or if the current user is the originator.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSPersonNameComponents *originatorNameComponents API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* The modification date of the version, or possibly nil if the receiver's storage has been deleted.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSDate *modificationDate;
 | 
			
		||||
 | 
			
		||||
/* An object that can be encoded and, after subsequent decoding, passed to -versionOfItemAtURL:forPersistentIdentifier: to create a new instance of NSFileVersion that is equal to the receiver.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, retain) id<NSCoding> persistentIdentifier;
 | 
			
		||||
 | 
			
		||||
/* Whether the version was created as a result of the discovery of a conflict between two writers of the versioned file.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, getter=isConflict) BOOL conflict;
 | 
			
		||||
 | 
			
		||||
/* If the version is a conflict version, whether the conflict has been resolved. If the version is not a conflict version, simply YES.
 | 
			
		||||
 | 
			
		||||
The operating system's reaction to your setting this to YES is complicated and subject to change in future releases. One result however is that the version won't appear in arrays returned by +unresolvedConflictVersionsOfItemAtURL: anymore, unless setting fails.
 | 
			
		||||
 | 
			
		||||
Once you have indicated that a conflict has been resolved you cannot make it unresolved again. Setting this to NO causes an exception to be thrown.
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isResolved) BOOL resolved;
 | 
			
		||||
 | 
			
		||||
/* Whether the system is allowed to automatically delete the receiver's storage in the future, at an unpredictable time.
 | 
			
		||||
 | 
			
		||||
Setting this to YES can fail so you must not depend on discarding for correct operation.
 | 
			
		||||
 | 
			
		||||
Once you have indicated that a version is discardable you cannot make it undiscardable again. Setting this to NO causes an exception to be thrown.
 | 
			
		||||
 | 
			
		||||
You cannot make the versioned file itself discardable. Setting the value of this property always throws an exception when sent to the result of invoking +currentVersionOfItemAtURL:.
 | 
			
		||||
 | 
			
		||||
Versions can be discardable only on Mac OS X.
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isDiscardable) BOOL discardable API_AVAILABLE(macos(10.7)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* Whether the version has local contents. Versions that are returned by +getNonlocalVersionsOfItemAtURL:completionHandler: do not initially have local contents. You can only access their contents, either directly via the URL or by invoking -replaceItemAtURL:options:error:, from within a coordinated read on the NSFileVersion's URL.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) BOOL hasLocalContents API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Whether the version has a thumbnail image available. Thumbnails for versions from +getNonlocalVersionsOfItemAtURL:completionHandler: may not immediately be available. As soon as it becomes available, this property will change from NO to YES. You can use KVO to be notified of this change. If a thumbnail is available, you can access it using NSURLThumbnailKey or NSURLThumbnailDictionaryKey.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) BOOL hasThumbnail API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* If the passed-in URL locates a file, replace the file with a file whose contents are taken from the version but whose display name is taken from the file. If the passed-in URL does not locate a file then simply write one. If successful, return a URL that locates the resulting file; it may be different from the passed-in URL. The one exception to taking the display name from an existing file is if the version is of a different type than the overwritten file. In that case the file name extension will be taken from the version. (When file name extensions are being hidden in a user-friendly way this is not actually an exception.) If not successful, return NO after setting *outError to an NSError that encapsulates why not.
 | 
			
		||||
 | 
			
		||||
When you use NSFileVersionReplacingByMoving you remove a version of the file, and should do it as part of a coordinated write to the file. The advice about this for +addVersionOfItemAtURL:withContentsOfURL:options:error: applies here too. When you use it to promote a version to a separate file you actually write to two files, and should do it as part of a coordinated write to two files, using -[NSFileCoordinator coordinateWritingItemAtURL:options:writingItemAtURL:options:error:byAccessor:], most likely using NSFileCoordinatorWritingForReplacing for the file you're promoting the version to.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSURL *)replaceItemAtURL:(NSURL *)url options:(NSFileVersionReplacingOptions)options error:(NSError **)error;
 | 
			
		||||
 | 
			
		||||
/* Delete the receiver's storage, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates why not. Subsequent invocations of +versionsOfItemAtURL: won't include an NSFileVersion for a successfully removed version.
 | 
			
		||||
 | 
			
		||||
You cannot use this method to delete the versioned file itself. This method always throws an exception when sent to the result of invoking +currentVersionOfItemAtURL:. Use -[NSFileManager removeItemAtURL:error:] for that instead.
 | 
			
		||||
 | 
			
		||||
When removing versions of a file you should do it as part of a coordinated write to the file. The advice about this for +addVersionOfItemAtURL:withContentsOfURL:options:error: applies here too.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)removeAndReturnError:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Delete all of the versions associated with the file located by a URL, except for the current one, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates why not.
 | 
			
		||||
 | 
			
		||||
When removing versions of a file you should do it as part of a coordinated write to the file. The advice about this for +addVersionOfItemAtURL:withContentsOfURL:options:error: applies here too.
 | 
			
		||||
*/
 | 
			
		||||
+ (BOOL)removeOtherVersionsOfItemAtURL:(NSURL *)url error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,181 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFileWrapper.h
 | 
			
		||||
	Copyright (c) 1995-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSData, NSDictionary<KeyType, ObjectType>, NSError, NSString, NSURL;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFileWrapperReadingOptions) {
 | 
			
		||||
    
 | 
			
		||||
    /* Whether the contents are read immediately, applied recursively in the case of directory file wrappers. If reading with this option succeeds then subsequent invocations of -fileWrappers, -regularFileContents, -symbolicLinkDestinationURL:, -serializedRepresentation, and, on Mac OS X, -[NSFileWrapper(NSExtensions) icon] sent to the receiver and all its descendant file wrappers won't fail. For performance NSFileWrapper may or may not immediately read the contents of some file packages immediately even when this option is chosen. For example, the contents of bundles (not all file packages are bundles) are immutable to the user so on Mac OS X NSFileWrapper may read the children of such a directory lazily. You can use this option to take a reasonable snapshot of a file or folder for writing later. For example, a Mac OS X application like TextEdit can use this option when creating new file wrappers to represent attachments that the user creates by copying and pasting or dragging and dropping from the Finder to a TextEdit document. You wouldn't use this option when reading a document file package because that would cause unnecessarily bad perfomance. For example, an application wouldn't use this option when creating file wrappers to represent attachments as it's opening a document stored in a file package.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileWrapperReadingImmediate = 1 << 0,
 | 
			
		||||
 | 
			
		||||
    /* Whether file mapping for regular file wrappers is disallowed. In Mac OS 10.6 and newer NSFileWrapper only ever memory maps files on internal drives, regardless of whether this option is used. It never memory maps files on external drives or network volumes. You can use this option to keep NSFileWrapper from memory mapping files at all, even ones on internal drives. This is useful if you want to make sure your application doesn't hold files open (mapped files are open files) and therefore prevent the user from ejecting DVDs, unmounting disk partitions, or unmounting disk images.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileWrapperReadingWithoutMapping = 1 << 1
 | 
			
		||||
 | 
			
		||||
} API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFileWrapperWritingOptions) {
 | 
			
		||||
 | 
			
		||||
    /* Whether writing is done atomically. You can use this option to ensure that when overwriting a file package the overwriting either completely succeeds or completely fails, with no possibility of leaving the file package in an inconsistent state. Because this option causes additional I/O you shouldn't use it unnecessarily. For example, on Mac OS X you wouldn't use this option in an override of -[NSDocument writeToURL:ofType:error:] because NSDocument's implementation of safe saving already does atomic writing.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileWrapperWritingAtomic = 1 << 0,
 | 
			
		||||
 | 
			
		||||
    /* Whether descendant file wrappers are sent -setFilename: if the writing succeeds. This is necessary when your application passes original contents URLs to -writeToURL:options:originalContentsURL:error:. Without using this and reusing child file wrappers properly subsequent invocations of -writeToURL:options:originalContentsURL:error: wouldn't be able to reliably create hard links in a new file package for performance because the record of names in the old file package would be out of date.
 | 
			
		||||
    */
 | 
			
		||||
    NSFileWrapperWritingWithNameUpdating = 1 << 1
 | 
			
		||||
 | 
			
		||||
} API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.0), ios(4.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSFileWrapper : NSObject<NSSecureCoding> {
 | 
			
		||||
    @private
 | 
			
		||||
    NSDictionary *_fileAttributes;
 | 
			
		||||
    NSString *_preferredFileName;
 | 
			
		||||
    NSString *_fileName;
 | 
			
		||||
    id _contents;
 | 
			
		||||
    id _icon;
 | 
			
		||||
    id _moreVars;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Initialization ***
 | 
			
		||||
 | 
			
		||||
/* A designated initializer for creating an instance whose kind (directory, regular file, or symbolic link) is determined based on what the URL locates. If reading is not successful return nil after setting *outError to an NSError that encapsulates the reason why the file wrapper could not be read.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithURL:(NSURL *)url options:(NSFileWrapperReadingOptions)options error:(NSError **)outError NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* A designated initializer for creating an instance for which -isDirectory returns YES. The passed-in dictionary must contain entries whose values are the file wrappers that are to become children and whose keys are file names. Each file wrapper that does not already have a preferred file name is sent -setPreferredFilename: with the corresponding key as the argument.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initDirectoryWithFileWrappers:(NSDictionary<NSString *, NSFileWrapper *> *)childrenByPreferredName NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/* A designated initializer for creating an instance for which -isRegularFile returns YES.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initRegularFileWithContents:(NSData *)contents NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/* A designated initializer for creating an instance for which -isSymbolicLink returns YES. -writeToURL:options:originalContentsURL:error: uses the result of sending -relativePath to this URL when creating a symbolic link. (An NSURL initialized by -initFileURLWithPath: returns that entire path when sent -relativePath though.)
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initSymbolicLinkWithDestinationURL:(NSURL *)url NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* A designated initializer. The data must be in the same format as that returned by -serializedRepresentation.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithSerializedRepresentation:(NSData *)serializeRepresentation NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)inCoder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Properties Applicable to Every Kind of File Wrapper ***
 | 
			
		||||
 | 
			
		||||
/* What kind of file wrapper it is. Invocations of -readFromURL:options:error: may change what subsequent invocations of these methods return.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, getter=isDirectory) BOOL directory;
 | 
			
		||||
@property (readonly, getter=isRegularFile) BOOL regularFile;
 | 
			
		||||
@property (readonly, getter=isSymbolicLink) BOOL symbolicLink;
 | 
			
		||||
 | 
			
		||||
/* The file name that is "preferred." When the receiver is added to a parent directory file wrapper the parent will attempt to use this name as the key into its dictionary of children. Usually the preferred file name will actually get used in this situation but it won't be if that key is already in use. The default implementation of this method causes existing parents to remove and re-add the child to accommodate the change. Preferred file names of children are not effectively preserved when you write a file wrapper to disk and then later instantiate another file wrapper by reading. If your application needs to preserve the user-visible names of attachments it has to make its own arrangements for their storage.
 | 
			
		||||
 | 
			
		||||
Some instances of NSFileWrapper may be created without a preferredFilename (e.g. -initDirectoryWithFileWrappers: or -initRegularFileWithContents:), meaning preferredFilename may be nil. However, setting nil is never allowed and will result in an exception.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, copy) NSString *preferredFilename;
 | 
			
		||||
 | 
			
		||||
/* The actual file name. Often it will be the same as the preferred file name but might instead be a name derived from the preferred file name. You can use this method to find out the name of a child that's just been read but you should not use it to find out the name of a child that's about to be written, because the name might be about to change. Send -keyForFileWrapper: to the parent instead.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, copy) NSString *filename;
 | 
			
		||||
 | 
			
		||||
/* The file attributes, in a dictionary of the same sort as those returned by -[NSFileManager attributesOfItemAtPath:error:].
 | 
			
		||||
*/
 | 
			
		||||
@property (copy) NSDictionary<NSString *, id> *fileAttributes;
 | 
			
		||||
 | 
			
		||||
/* On Mac OS X methods for setting and getting the icon are in AppKit's NSFileWrapper(NSExtensions), declared in <AppKit/NSFileWrapperExtensions.h>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Reading ***
 | 
			
		||||
 | 
			
		||||
/* Whether the receiver matches the directory, regular file, or symbolic link that is located by the URL. For a directory, children are compared against the files in the directory, recursively. The contents of files are not compared; matching of regular files is based on file modification dates. Because children of directory file wrappers are not read immediately by -initWithURL:options:error: or -readFromURL:options:error: unless NSFileWrapperReadingImmediate is used, creating a file wrapper and then later sending it this message is not a reliable way to simply check whether anything in a directory has changed. You can use this method to determine whether the receiver's contents in memory are out of date relative to the file system.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)matchesContentsOfURL:(NSURL *)url API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Recursively reread the entire contents of the receiver from the specified location, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates the reason why the file wrapper could not be reread. When reading a directory children are added and removed as necessary to match the file system.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)readFromURL:(NSURL *)url options:(NSFileWrapperReadingOptions)options error:(NSError **)outError API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Writing ***
 | 
			
		||||
 | 
			
		||||
/* Recursively write the entire contents of the receiver at the specified location, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates the reason why the file wrapper could not be written. originalContentsURL may be nil or it may be the location of a previous revision of what is being written. If it is not nil the default implementation of this method attempts to avoid unnecessary I/O by merely writing hard links to regular files instead of actually writing out their contents. The descendant file wrappers must return accurate values when sent -filename for this to work (use NSFileWrapperWritingWithNameUpdating to increase the likelihood of that).
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)writeToURL:(NSURL *)url options:(NSFileWrapperWritingOptions)options originalContentsURL:(nullable NSURL *)originalContentsURL error:(NSError **)outError API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Serialization ***
 | 
			
		||||
 | 
			
		||||
/* Return an NSData suitable for passing to -initWithSerializedRepresentation:. This method may return nil if the receiver is the result of reading from the file system (use NSFileWrapperReadingImmediately if appropriate to prevent that).
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSData *serializedRepresentation;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Directories ***
 | 
			
		||||
 | 
			
		||||
/* Each of these methods throw an exception when [receiver isDirectory]==NO. */
 | 
			
		||||
 | 
			
		||||
/* Add a file wrapper to the receiver's children and return the file name that uniquely identifies it among the receiver's children. The unique file name will be the same as the passed-in file wrapper's preferred file name unless that name is already in use as a key into the receiver's dictionary of children. Beware of the fact that -initDirectoryWithFileWrappers:, -initRegularFileWithContents:, and -initSymbolicLinkWithDestinationURL: do not automatically set the preferred file name.
 | 
			
		||||
*/
 | 
			
		||||
- (NSString *)addFileWrapper:(NSFileWrapper *)child;
 | 
			
		||||
 | 
			
		||||
/* A convenience method. The default implementation merely allocates a new file wrapper, initializes it with -initRegularFileWithContents:, sends it -setPreferredFileName:fileName, adds it to the receiver with -addFileWrapper:, and returns what -addFileWrapper: returned.
 | 
			
		||||
*/
 | 
			
		||||
- (NSString *)addRegularFileWithContents:(NSData *)data preferredFilename:(NSString *)fileName;
 | 
			
		||||
 | 
			
		||||
/* Remove a file wrapper from the receiver's children.
 | 
			
		||||
*/
 | 
			
		||||
- (void)removeFileWrapper:(NSFileWrapper *)child;
 | 
			
		||||
 | 
			
		||||
/* Return a dictionary whose values are the receiver's children and whose keys are the unique file name that has been assigned to each one. This method may return nil if the receiver is the result of reading a parent from the file system (use NSFileWrapperReadingImmediately if appropriate to prevent that).
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSDictionary<NSString *, NSFileWrapper *> *fileWrappers;
 | 
			
		||||
 | 
			
		||||
/* Return the unique file name that has been assigned to a child or nil if it is not a child of the receiver.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSString *)keyForFileWrapper:(NSFileWrapper *)child;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Regular Files ***
 | 
			
		||||
 | 
			
		||||
/* This method throws an exception when [receiver isRegularFile]==NO. */
 | 
			
		||||
 | 
			
		||||
/* Return the receiver's contents. This may return nil if the receiver is the result of reading a parent from the file system (use NSFileWrapperReadingImmediately if appropriate to prevent that).
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSData *regularFileContents;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Symbolic Links ***
 | 
			
		||||
 | 
			
		||||
/* This method throws an exception when [receiver isSymbolicLink]==NO. */
 | 
			
		||||
 | 
			
		||||
/* Return the destination link of the receiver. This may return nil if the receiver is the result of reading a parent from the file system (use NSFileWrapperReadingImmediately if appropriate to prevent that).
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *symbolicLinkDestinationURL API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
 | 
			
		||||
@interface NSFileWrapper(NSDeprecated)
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Backward Compatibility ***
 | 
			
		||||
 | 
			
		||||
/* Methods that were deprecated in OS X 10.6 and never available on iOS. */
 | 
			
		||||
 | 
			
		||||
- (nullable id)initWithPath:(NSString *)path API_DEPRECATED("Use -initWithURL:options:error: instead.", macos(10.0,10.10)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
- (id)initSymbolicLinkWithDestination:(NSString *)path API_DEPRECATED("Use -initSymbolicLinkWithDestinationURL: and -setPreferredFileName:, if necessary, instead.", macos(10.0,10.10)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
- (BOOL)needsToBeUpdatedFromPath:(NSString *)path API_DEPRECATED("Use -matchesContentsOfURL: instead.", macos(10.0,10.10)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
- (BOOL)updateFromPath:(NSString *)path API_DEPRECATED("Use -readFromURL:options:error: instead.", macos(10.0,10.10)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)atomicFlag updateFilenames:(BOOL)updateFilenamesFlag API_DEPRECATED("Use -writeToURL:options:originalContentsURL:error: instead.", macos(10.0,10.10)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
- (NSString *)addFileWithPath:(NSString *)path API_DEPRECATED("Instantiate a new NSFileWrapper with -initWithURL:options:error:, send it -setPreferredFileName: if necessary, then use -addFileWrapper: instead.", macos(10.0,10.10)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
- (NSString *)addSymbolicLinkWithDestination:(NSString *)path preferredFilename:(NSString *)filename API_DEPRECATED("Instantiate a new NSFileWrapper with -initWithSymbolicLinkDestinationURL:, send it -setPreferredFileName: if necessary, then use -addFileWrapper: instead.", macos(10.0,10.10)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
- (NSString *)symbolicLinkDestination API_DEPRECATED("Use -symbolicLinkDestinationURL instead.", macos(10.0,10.10)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,65 @@
 | 
			
		||||
/*	NSFormatter.h
 | 
			
		||||
	Copyright (c) 1995-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSRange.h>
 | 
			
		||||
#import <Foundation/NSAttributedString.h>
 | 
			
		||||
 | 
			
		||||
@class NSString;
 | 
			
		||||
@class NSAttributedString;
 | 
			
		||||
@class NSDictionary<KeyType, ObjectType>;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSFormattingContext) {
 | 
			
		||||
    
 | 
			
		||||
    // The capitalization context to be used is unknown (this is the default value).
 | 
			
		||||
    NSFormattingContextUnknown = 0,
 | 
			
		||||
    
 | 
			
		||||
    // The capitalization context is determined dynamically from the set {NSFormattingContextStandalone, NSFormattingContextBeginningOfSentence, NSFormattingContextMiddleOfSentence}. For example, if a date is placed at the beginning of a sentence, NSFormattingContextBeginningOfSentence is used to format the string automatically. When this context is used, the formatter will return a string proxy that works like a normal string in most cases. After returning from the formatter, the string in the string proxy is formatted by using NSFormattingContextUnknown. When the string proxy is used in stringWithFormat:, we can determine where the %@ is and then set the context accordingly. With the new context, the string in the string proxy will be formatted again and be put into the final string returned from stringWithFormat:.
 | 
			
		||||
    NSFormattingContextDynamic = 1,
 | 
			
		||||
    
 | 
			
		||||
    // The capitalization context if a date or date symbol is to be formatted with capitalization appropriate for stand-alone usage such as an isolated name on a calendar page.
 | 
			
		||||
    NSFormattingContextStandalone = 2,
 | 
			
		||||
    
 | 
			
		||||
    // The capitalization context if a date or date symbol is to be formatted with capitalization appropriate for a list or menu item.
 | 
			
		||||
    NSFormattingContextListItem = 3,
 | 
			
		||||
    
 | 
			
		||||
    // The capitalization context if a date or date symbol is to be formatted with capitalization appropriate for the beginning of a sentence.
 | 
			
		||||
    NSFormattingContextBeginningOfSentence = 4,
 | 
			
		||||
    
 | 
			
		||||
    // The capitalization context if a date or date symbol is to be formatted with capitalization appropriate for the middle of a sentence.
 | 
			
		||||
    NSFormattingContextMiddleOfSentence = 5,
 | 
			
		||||
    
 | 
			
		||||
} API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * There are 3 widths: long, medium, and short.
 | 
			
		||||
 * For example, for English, when formatting "3 pounds"
 | 
			
		||||
 * Long is "3 pounds"; medium is "3 lb"; short is "3#";
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSFormattingUnitStyle) {
 | 
			
		||||
    NSFormattingUnitStyleShort = 1,
 | 
			
		||||
    NSFormattingUnitStyleMedium,
 | 
			
		||||
    NSFormattingUnitStyleLong,
 | 
			
		||||
} API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@interface NSFormatter : NSObject <NSCopying, NSCoding>
 | 
			
		||||
 | 
			
		||||
- (nullable NSString *)stringForObjectValue:(nullable id)obj;
 | 
			
		||||
 | 
			
		||||
- (nullable NSAttributedString *)attributedStringForObjectValue:(id)obj withDefaultAttributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attrs;
 | 
			
		||||
 | 
			
		||||
- (nullable NSString *)editingStringForObjectValue:(id)obj;
 | 
			
		||||
 | 
			
		||||
- (BOOL)getObjectValue:(out id _Nullable * _Nullable)obj forString:(NSString *)string errorDescription:(out NSString * _Nullable * _Nullable)error;
 | 
			
		||||
 | 
			
		||||
- (BOOL)isPartialStringValid:(NSString *)partialString newEditingString:(NSString * _Nullable * _Nullable)newString errorDescription:(NSString * _Nullable * _Nullable)error;
 | 
			
		||||
    // Compatibility method.  If a subclass overrides this and does not override the new method below, this will be called as before (the new method just calls this one by default).  The selection range will always be set to the end of the text with this method if replacement occurs.
 | 
			
		||||
 | 
			
		||||
- (BOOL)isPartialStringValid:(NSString * _Nonnull * _Nonnull)partialStringPtr proposedSelectedRange:(nullable NSRangePointer)proposedSelRangePtr originalString:(NSString *)origString originalSelectedRange:(NSRange)origSelRange errorDescription:(NSString * _Nullable * _Nullable)error;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,33 @@
 | 
			
		||||
/*	NSGarbageCollector.h
 | 
			
		||||
	Copyright (c) 2006-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Building Garbage Collected apps is no longer supported.", macos(10.5, 10.10)) API_UNAVAILABLE(ios, watchos, tvos)
 | 
			
		||||
NS_AUTOMATED_REFCOUNT_UNAVAILABLE
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("Garbage Collection is not supported")
 | 
			
		||||
@interface NSGarbageCollector : NSObject
 | 
			
		||||
 | 
			
		||||
+ (id)defaultCollector;
 | 
			
		||||
 | 
			
		||||
- (BOOL)isCollecting API_DEPRECATED("", macos(10.0, 10.6)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
- (void)disable;
 | 
			
		||||
- (void)enable;
 | 
			
		||||
- (BOOL)isEnabled;
 | 
			
		||||
 | 
			
		||||
- (void)collectIfNeeded;
 | 
			
		||||
- (void)collectExhaustively;
 | 
			
		||||
 | 
			
		||||
- (void)disableCollectorForPointer:(const void *)ptr;
 | 
			
		||||
- (void)enableCollectorForPointer:(const void *)ptr;
 | 
			
		||||
 | 
			
		||||
- (NSZone *)zone;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,288 @@
 | 
			
		||||
/*	NSGeometry.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AvailabilityMacros.h>
 | 
			
		||||
#import <Foundation/NSValue.h>
 | 
			
		||||
#import <Foundation/NSCoder.h>
 | 
			
		||||
 | 
			
		||||
#import <CoreGraphics/CGBase.h>
 | 
			
		||||
#import <CoreGraphics/CGGeometry.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
#if __LP64__ || TARGET_OS_IPHONE || NS_BUILD_32_LIKE_64
 | 
			
		||||
 | 
			
		||||
typedef CGPoint NSPoint;
 | 
			
		||||
 | 
			
		||||
typedef NSPoint *NSPointPointer;
 | 
			
		||||
typedef NSPoint *NSPointArray;
 | 
			
		||||
 | 
			
		||||
typedef CGSize NSSize;
 | 
			
		||||
 | 
			
		||||
typedef NSSize *NSSizePointer;
 | 
			
		||||
typedef NSSize *NSSizeArray;
 | 
			
		||||
 | 
			
		||||
typedef CGRect NSRect;
 | 
			
		||||
 | 
			
		||||
typedef NSRect *NSRectPointer;
 | 
			
		||||
typedef NSRect *NSRectArray;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSRectEdge) {
 | 
			
		||||
    NSRectEdgeMinX = CGRectMinXEdge,
 | 
			
		||||
    NSRectEdgeMinY = CGRectMinYEdge,
 | 
			
		||||
    NSRectEdgeMaxX = CGRectMaxXEdge,
 | 
			
		||||
    NSRectEdgeMaxY = CGRectMaxYEdge,
 | 
			
		||||
    
 | 
			
		||||
    NSMinXEdge NS_SWIFT_UNAVAILABLE("Use NSRectEdge.MinX instead") = NSRectEdgeMinX,
 | 
			
		||||
    NSMinYEdge NS_SWIFT_UNAVAILABLE("Use NSRectEdge.MinY instead") = NSRectEdgeMinY,
 | 
			
		||||
    NSMaxXEdge NS_SWIFT_UNAVAILABLE("Use NSRectEdge.MaxX instead") = NSRectEdgeMaxX,
 | 
			
		||||
    NSMaxYEdge NS_SWIFT_UNAVAILABLE("Use NSRectEdge.MaxY instead") = NSRectEdgeMaxY,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES 1
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
typedef struct _NSPoint {
 | 
			
		||||
    CGFloat x;
 | 
			
		||||
    CGFloat y;
 | 
			
		||||
} NSPoint;
 | 
			
		||||
 | 
			
		||||
typedef NSPoint *NSPointPointer;
 | 
			
		||||
typedef NSPoint *NSPointArray;
 | 
			
		||||
 | 
			
		||||
typedef struct _NSSize {
 | 
			
		||||
    CGFloat width;		/* should never be negative */
 | 
			
		||||
    CGFloat height;		/* should never be negative */
 | 
			
		||||
} NSSize;
 | 
			
		||||
 | 
			
		||||
typedef NSSize *NSSizePointer;
 | 
			
		||||
typedef NSSize *NSSizeArray;
 | 
			
		||||
 | 
			
		||||
typedef struct _NSRect {
 | 
			
		||||
    NSPoint origin;
 | 
			
		||||
    NSSize size;
 | 
			
		||||
} NSRect;
 | 
			
		||||
 | 
			
		||||
typedef NSRect *NSRectPointer;
 | 
			
		||||
typedef NSRect *NSRectArray;
 | 
			
		||||
 | 
			
		||||
typedef enum {
 | 
			
		||||
    NSRectEdgeMinX = 0,
 | 
			
		||||
    NSRectEdgeMinY = 1,
 | 
			
		||||
    NSRectEdgeMaxX = 2,
 | 
			
		||||
    NSRectEdgeMaxY = 3,
 | 
			
		||||
    
 | 
			
		||||
    NSMinXEdge = NSRectEdgeMinX,
 | 
			
		||||
    NSMinYEdge = NSRectEdgeMinY,
 | 
			
		||||
    NSMaxXEdge = NSRectEdgeMaxX,
 | 
			
		||||
    NSMaxYEdge = NSRectEdgeMaxY,
 | 
			
		||||
} NSRectEdge;
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define NSEDGEINSETS_DEFINED 1
 | 
			
		||||
typedef struct NSEdgeInsets {
 | 
			
		||||
    CGFloat top;
 | 
			
		||||
    CGFloat left;
 | 
			
		||||
    CGFloat bottom;
 | 
			
		||||
    CGFloat right;
 | 
			
		||||
} NSEdgeInsets;
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(unsigned long long, NSAlignmentOptions) {
 | 
			
		||||
    NSAlignMinXInward   = 1ULL << 0,
 | 
			
		||||
    NSAlignMinYInward   = 1ULL << 1,
 | 
			
		||||
    NSAlignMaxXInward   = 1ULL << 2,
 | 
			
		||||
    NSAlignMaxYInward   = 1ULL << 3,
 | 
			
		||||
    NSAlignWidthInward  = 1ULL << 4,
 | 
			
		||||
    NSAlignHeightInward = 1ULL << 5,
 | 
			
		||||
    
 | 
			
		||||
    NSAlignMinXOutward   = 1ULL << 8,
 | 
			
		||||
    NSAlignMinYOutward   = 1ULL << 9,
 | 
			
		||||
    NSAlignMaxXOutward   = 1ULL << 10,
 | 
			
		||||
    NSAlignMaxYOutward   = 1ULL << 11,
 | 
			
		||||
    NSAlignWidthOutward  = 1ULL << 12,
 | 
			
		||||
    NSAlignHeightOutward = 1ULL << 13,
 | 
			
		||||
    
 | 
			
		||||
    NSAlignMinXNearest   = 1ULL << 16,
 | 
			
		||||
    NSAlignMinYNearest   = 1ULL << 17,
 | 
			
		||||
    NSAlignMaxXNearest   = 1ULL << 18,
 | 
			
		||||
    NSAlignMaxYNearest   = 1ULL << 19,
 | 
			
		||||
    NSAlignWidthNearest  = 1ULL << 20,
 | 
			
		||||
    NSAlignHeightNearest = 1ULL << 21,
 | 
			
		||||
    
 | 
			
		||||
    NSAlignRectFlipped = 1ULL << 63, // pass this if the rect is in a flipped coordinate system. This allows 0.5 to be treated in a visually consistent way.
 | 
			
		||||
 | 
			
		||||
    // convenience combinations
 | 
			
		||||
    NSAlignAllEdgesInward = NSAlignMinXInward|NSAlignMaxXInward|NSAlignMinYInward|NSAlignMaxYInward,
 | 
			
		||||
    NSAlignAllEdgesOutward = NSAlignMinXOutward|NSAlignMaxXOutward|NSAlignMinYOutward|NSAlignMaxYOutward,
 | 
			
		||||
    NSAlignAllEdgesNearest = NSAlignMinXNearest|NSAlignMaxXNearest|NSAlignMinYNearest|NSAlignMaxYNearest,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@class NSString;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT const NSPoint NSZeroPoint;
 | 
			
		||||
FOUNDATION_EXPORT const NSSize NSZeroSize;
 | 
			
		||||
FOUNDATION_EXPORT const NSRect NSZeroRect;
 | 
			
		||||
FOUNDATION_EXPORT const NSEdgeInsets NSEdgeInsetsZero API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSPoint NSMakePoint(CGFloat x, CGFloat y) {
 | 
			
		||||
    NSPoint p;
 | 
			
		||||
    p.x = x;
 | 
			
		||||
    p.y = y;
 | 
			
		||||
    return p;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSize NSMakeSize(CGFloat w, CGFloat h) {
 | 
			
		||||
    NSSize s;
 | 
			
		||||
    s.width = w;
 | 
			
		||||
    s.height = h;
 | 
			
		||||
    return s;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSRect NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h) {
 | 
			
		||||
    NSRect r;
 | 
			
		||||
    r.origin.x = x;
 | 
			
		||||
    r.origin.y = y;
 | 
			
		||||
    r.size.width = w;
 | 
			
		||||
    r.size.height = h;
 | 
			
		||||
    return r;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGFloat NSMaxX(NSRect aRect) {
 | 
			
		||||
    return (aRect.origin.x + aRect.size.width);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGFloat NSMaxY(NSRect aRect) {
 | 
			
		||||
    return (aRect.origin.y + aRect.size.height);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGFloat NSMidX(NSRect aRect) {
 | 
			
		||||
    return (aRect.origin.x + aRect.size.width * (CGFloat)0.5);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGFloat NSMidY(NSRect aRect) {
 | 
			
		||||
    return (aRect.origin.y + aRect.size.height * (CGFloat)0.5);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGFloat NSMinX(NSRect aRect) {
 | 
			
		||||
    return (aRect.origin.x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGFloat NSMinY(NSRect aRect) {
 | 
			
		||||
    return (aRect.origin.y);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGFloat NSWidth(NSRect aRect) {
 | 
			
		||||
    return (aRect.size.width);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGFloat NSHeight(NSRect aRect) {
 | 
			
		||||
    return (aRect.size.height);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSRect NSRectFromCGRect(CGRect cgrect) {
 | 
			
		||||
    union _ {NSRect ns; CGRect cg;};
 | 
			
		||||
    return ((union _ *)&cgrect)->ns;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGRect NSRectToCGRect(NSRect nsrect) {
 | 
			
		||||
    union _ {NSRect ns; CGRect cg;};
 | 
			
		||||
    return ((union _ *)&nsrect)->cg;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSPoint NSPointFromCGPoint(CGPoint cgpoint) {
 | 
			
		||||
    union _ {NSPoint ns; CGPoint cg;};
 | 
			
		||||
    return ((union _ *)&cgpoint)->ns;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGPoint NSPointToCGPoint(NSPoint nspoint) {
 | 
			
		||||
    union _ {NSPoint ns; CGPoint cg;};
 | 
			
		||||
    return ((union _ *)&nspoint)->cg;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSSize NSSizeFromCGSize(CGSize cgsize) {
 | 
			
		||||
    union _ {NSSize ns; CGSize cg;};
 | 
			
		||||
    return ((union _ *)&cgsize)->ns;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE CGSize NSSizeToCGSize(NSSize nssize) {
 | 
			
		||||
    union _ {NSSize ns; CGSize cg;};
 | 
			
		||||
    return ((union _ *)&nssize)->cg;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSEdgeInsets NSEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat bottom, CGFloat right) {
 | 
			
		||||
    NSEdgeInsets e;
 | 
			
		||||
    e.top = top;
 | 
			
		||||
    e.left = left;
 | 
			
		||||
    e.bottom = bottom;
 | 
			
		||||
    e.right = right;
 | 
			
		||||
    return e;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSEqualPoints(NSPoint aPoint, NSPoint bPoint);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSEqualSizes(NSSize aSize, NSSize bSize);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSEqualRects(NSRect aRect, NSRect bRect);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSIsEmptyRect(NSRect aRect);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSEdgeInsetsEqual(NSEdgeInsets aInsets, NSEdgeInsets bInsets) API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSRect NSInsetRect(NSRect aRect, CGFloat dX, CGFloat dY);
 | 
			
		||||
FOUNDATION_EXPORT NSRect NSIntegralRect(NSRect aRect);
 | 
			
		||||
FOUNDATION_EXPORT NSRect NSIntegralRectWithOptions(NSRect aRect, NSAlignmentOptions opts) API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSRect NSUnionRect(NSRect aRect, NSRect bRect);
 | 
			
		||||
FOUNDATION_EXPORT NSRect NSIntersectionRect(NSRect aRect, NSRect bRect);
 | 
			
		||||
FOUNDATION_EXPORT NSRect NSOffsetRect(NSRect aRect, CGFloat dX, CGFloat dY);
 | 
			
		||||
FOUNDATION_EXPORT void NSDivideRect(NSRect inRect, NSRect *slice, NSRect *rem, CGFloat amount, NSRectEdge edge);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSPointInRect(NSPoint aPoint, NSRect aRect);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSMouseInRect(NSPoint aPoint, NSRect aRect, BOOL flipped);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSContainsRect(NSRect aRect, NSRect bRect);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSIntersectsRect(NSRect aRect, NSRect bRect);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSStringFromPoint(NSPoint aPoint);
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSStringFromSize(NSSize aSize);
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSStringFromRect(NSRect aRect);
 | 
			
		||||
FOUNDATION_EXPORT NSPoint NSPointFromString(NSString *aString);
 | 
			
		||||
FOUNDATION_EXPORT NSSize NSSizeFromString(NSString *aString);
 | 
			
		||||
FOUNDATION_EXPORT NSRect NSRectFromString(NSString *aString);
 | 
			
		||||
 | 
			
		||||
@interface NSValue (NSValueGeometryExtensions)
 | 
			
		||||
 | 
			
		||||
+ (NSValue *)valueWithPoint:(NSPoint)point;
 | 
			
		||||
+ (NSValue *)valueWithSize:(NSSize)size;
 | 
			
		||||
+ (NSValue *)valueWithRect:(NSRect)rect;
 | 
			
		||||
+ (NSValue *)valueWithEdgeInsets:(NSEdgeInsets)insets API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSPoint pointValue;
 | 
			
		||||
@property (readonly) NSSize sizeValue;
 | 
			
		||||
@property (readonly) NSRect rectValue;
 | 
			
		||||
@property (readonly) NSEdgeInsets edgeInsetsValue API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCoder (NSGeometryCoding)
 | 
			
		||||
 | 
			
		||||
- (void)encodePoint:(NSPoint)point;
 | 
			
		||||
- (NSPoint)decodePoint;
 | 
			
		||||
 | 
			
		||||
- (void)encodeSize:(NSSize)size;
 | 
			
		||||
- (NSSize)decodeSize;
 | 
			
		||||
 | 
			
		||||
- (void)encodeRect:(NSRect)rect;
 | 
			
		||||
- (NSRect)decodeRect;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCoder (NSGeometryKeyedCoding)
 | 
			
		||||
 | 
			
		||||
- (void)encodePoint:(NSPoint)point forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeSize:(NSSize)size forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeRect:(NSRect)rect forKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
- (NSPoint)decodePointForKey:(NSString *)key;
 | 
			
		||||
- (NSSize)decodeSizeForKey:(NSString *)key;
 | 
			
		||||
- (NSRect)decodeRectForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,18 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSHFSFileTypes.h
 | 
			
		||||
	Copyright (c) 2000-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
#import <CoreFoundation/CFBase.h>
 | 
			
		||||
 | 
			
		||||
@class NSString;
 | 
			
		||||
 | 
			
		||||
// Given an HFS file type code, return a string that represents the file type.  The string will have been autoreleased.  The format of the string is a private implementation detail, but such strings are suitable for inclusion in arrays that also contain file name extension strings.  Several Cocoa API methods take such arrays.
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSFileTypeForHFSTypeCode(OSType hfsFileTypeCode);
 | 
			
		||||
 | 
			
		||||
// Given a string of the sort encoded by NSFileTypeForHFSTypeCode(), return the corresponding HFS file type code.  Return zero otherwise.
 | 
			
		||||
FOUNDATION_EXPORT OSType NSHFSTypeCodeFromFileType(NSString *fileTypeString);
 | 
			
		||||
 | 
			
		||||
// Given the full absolute path of a file, return a string that represents the file's HFS file type as described above, or nil if the operation is not successful.  The string will have been autoreleased.
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSHFSTypeOfFile(NSString *fullFilePath);
 | 
			
		||||
@@ -0,0 +1,438 @@
 | 
			
		||||
/*	
 | 
			
		||||
    NSHTTPCookie.h
 | 
			
		||||
    Copyright (c) 2003-2019, Apple Inc. All rights reserved.    
 | 
			
		||||
    
 | 
			
		||||
    Public header file.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>;
 | 
			
		||||
@class NSDate;
 | 
			
		||||
@class NSDictionary<KeyType, ObjectType>;
 | 
			
		||||
@class NSNumber;
 | 
			
		||||
@class NSString;
 | 
			
		||||
@class NSURL;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSHTTPCookiePropertyKey NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
typedef NSString * NSHTTPCookieStringPolicy NS_TYPED_ENUM;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieName
 | 
			
		||||
    @discussion Key for cookie name
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieName API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieValue
 | 
			
		||||
    @discussion Key for cookie value
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieValue API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieOriginURL
 | 
			
		||||
    @discussion Key for cookie origin URL
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieOriginURL API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieVersion
 | 
			
		||||
    @discussion Key for cookie version
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieVersion API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieDomain
 | 
			
		||||
    @discussion Key for cookie domain
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieDomain API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookiePath
 | 
			
		||||
    @discussion Key for cookie path
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookiePath API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieSecure
 | 
			
		||||
    @discussion Key for cookie secure flag
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieSecure API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieExpires
 | 
			
		||||
    @discussion Key for cookie expiration date
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieExpires API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieComment
 | 
			
		||||
    @discussion Key for cookie comment text
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieComment API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieCommentURL
 | 
			
		||||
    @discussion Key for cookie comment URL
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieCommentURL API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieDiscard
 | 
			
		||||
    @discussion Key for cookie discard (session-only) flag
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieDiscard API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieMaximumAge
 | 
			
		||||
    @discussion Key for cookie maximum age (an alternate way of specifying the expiration)
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieMaximumAge API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookiePort
 | 
			
		||||
    @discussion Key for cookie ports
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookiePort API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 @const NSHTTPCookieSameSitePolicy
 | 
			
		||||
 @discussion Key for cookie same site
 | 
			
		||||
 */
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookiePropertyKey const NSHTTPCookieSameSitePolicy API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 @const NSHTTPCookieSameSiteLax
 | 
			
		||||
 @discussion String constant "lax" to be used as a value for the property key NSHTTPCookieSameSite
 | 
			
		||||
 */
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookieStringPolicy const NSHTTPCookieSameSiteLax API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 @const NSHTTPCookieSameSiteStrict
 | 
			
		||||
 @discussion String constant "strict" to be used as a value for the property key NSHTTPCookieSameSite
 | 
			
		||||
 */
 | 
			
		||||
FOUNDATION_EXPORT NSHTTPCookieStringPolicy const NSHTTPCookieSameSiteStrict API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
@class NSHTTPCookieInternal;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @class NSHTTPCookie
 | 
			
		||||
    @abstract NSHTTPCookie represents an http cookie.
 | 
			
		||||
    @discussion A NSHTTPCookie instance represents a single http cookie. It is
 | 
			
		||||
    an immutable object initialized from a dictionary that contains
 | 
			
		||||
    the various cookie attributes. It has accessors to get the various
 | 
			
		||||
    attributes of a cookie.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSHTTPCookie : NSObject
 | 
			
		||||
{
 | 
			
		||||
@private
 | 
			
		||||
    NSHTTPCookieInternal * _cookiePrivate;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @method initWithProperties:
 | 
			
		||||
    @abstract Initialize a NSHTTPCookie object with a dictionary of
 | 
			
		||||
    parameters
 | 
			
		||||
    @param properties The dictionary of properties to be used to
 | 
			
		||||
    initialize this cookie.
 | 
			
		||||
    @discussion Supported dictionary keys and value types for the
 | 
			
		||||
    given dictionary are as follows.
 | 
			
		||||
 | 
			
		||||
    All properties can handle an NSString value, but some can also
 | 
			
		||||
    handle other types.
 | 
			
		||||
 | 
			
		||||
    <table border="1" cellspacing="2" cellpadding="4">
 | 
			
		||||
    <tr>
 | 
			
		||||
        <th>Property key constant</th>
 | 
			
		||||
        <th>Type of value</th>
 | 
			
		||||
        <th>Required</th>
 | 
			
		||||
        <th>Description</th>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieComment</td>
 | 
			
		||||
        <td>NSString</td>
 | 
			
		||||
        <td>NO</td>
 | 
			
		||||
        <td>Comment for the cookie. Only valid for version 1 cookies and
 | 
			
		||||
        later. Default is nil.</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieCommentURL</td>
 | 
			
		||||
        <td>NSURL or NSString</td>
 | 
			
		||||
        <td>NO</td>
 | 
			
		||||
        <td>Comment URL for the cookie. Only valid for version 1 cookies
 | 
			
		||||
        and later. Default is nil.</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieDomain</td>
 | 
			
		||||
        <td>NSString</td>
 | 
			
		||||
        <td>Special, a value for either NSHTTPCookieOriginURL or
 | 
			
		||||
        NSHTTPCookieDomain must be specified.</td>
 | 
			
		||||
        <td>Domain for the cookie. Inferred from the value for
 | 
			
		||||
        NSHTTPCookieOriginURL if not provided.</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieDiscard</td>
 | 
			
		||||
        <td>NSString</td>
 | 
			
		||||
        <td>NO</td>
 | 
			
		||||
        <td>A string stating whether the cookie should be discarded at
 | 
			
		||||
        the end of the session. String value must be either "TRUE" or
 | 
			
		||||
        "FALSE". Default is "FALSE", unless this is cookie is version
 | 
			
		||||
        1 or greater and a value for NSHTTPCookieMaximumAge is not
 | 
			
		||||
        specified, in which case it is assumed "TRUE".</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieExpires</td>
 | 
			
		||||
        <td>NSDate or NSString</td>
 | 
			
		||||
        <td>NO</td>
 | 
			
		||||
        <td>Expiration date for the cookie. Used only for version 0
 | 
			
		||||
        cookies. Ignored for version 1 or greater.</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieMaximumAge</td>
 | 
			
		||||
        <td>NSString</td>
 | 
			
		||||
        <td>NO</td>
 | 
			
		||||
        <td>A string containing an integer value stating how long in
 | 
			
		||||
        seconds the cookie should be kept, at most. Only valid for
 | 
			
		||||
        version 1 cookies and later. Default is "0".</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieName</td>
 | 
			
		||||
        <td>NSString</td>
 | 
			
		||||
        <td>YES</td>
 | 
			
		||||
        <td>Name of the cookie</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieOriginURL</td>
 | 
			
		||||
        <td>NSURL or NSString</td>
 | 
			
		||||
        <td>Special, a value for either NSHTTPCookieOriginURL or
 | 
			
		||||
        NSHTTPCookieDomain must be specified.</td>
 | 
			
		||||
        <td>URL that set this cookie. Used as default for other fields
 | 
			
		||||
        as noted.</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookiePath</td>
 | 
			
		||||
        <td>NSString</td>
 | 
			
		||||
        <td>NO</td>
 | 
			
		||||
        <td>Path for the cookie. Inferred from the value for
 | 
			
		||||
        NSHTTPCookieOriginURL if not provided. Default is "/".</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookiePort</td>
 | 
			
		||||
        <td>NSString</td>
 | 
			
		||||
        <td>NO</td>
 | 
			
		||||
        <td>comma-separated integer values specifying the ports for the
 | 
			
		||||
        cookie. Only valid for version 1 cookies and later. Default is
 | 
			
		||||
        empty string ("").</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieSecure</td>
 | 
			
		||||
        <td>NSString</td>
 | 
			
		||||
        <td>NO</td>
 | 
			
		||||
        <td>A string stating whether the cookie should be transmitted
 | 
			
		||||
        only over secure channels. String value must be either "TRUE"
 | 
			
		||||
        or "FALSE". Default is "FALSE".</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieValue</td>
 | 
			
		||||
        <td>NSString</td>
 | 
			
		||||
        <td>YES</td>
 | 
			
		||||
        <td>Value of the cookie</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    <tr>
 | 
			
		||||
        <td>NSHTTPCookieVersion</td>
 | 
			
		||||
        <td>NSString</td>
 | 
			
		||||
        <td>NO</td>
 | 
			
		||||
        <td>Specifies the version of the cookie. Must be either "0" or
 | 
			
		||||
        "1". Default is "0".</td>
 | 
			
		||||
    </tr>
 | 
			
		||||
    </table>
 | 
			
		||||
    <p>
 | 
			
		||||
    All other keys are ignored.
 | 
			
		||||
    @result An initialized NSHTTPCookie, or nil if the set of
 | 
			
		||||
    dictionary keys is invalid, for example because a required key is
 | 
			
		||||
    missing, or a recognized key maps to an illegal value.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithProperties:(NSDictionary<NSHTTPCookiePropertyKey, id> *)properties;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @method cookieWithProperties:
 | 
			
		||||
    @abstract Allocates and initializes an NSHTTPCookie with the given
 | 
			
		||||
    dictionary.
 | 
			
		||||
    @discussion See the NSHTTPCookie <tt>-initWithProperties:</tt>
 | 
			
		||||
    method for more information on the constraints imposed on the
 | 
			
		||||
    dictionary, and for descriptions of the supported keys and values.
 | 
			
		||||
    @param properties The dictionary to use to initialize this cookie.
 | 
			
		||||
    @result A newly-created and autoreleased NSHTTPCookie instance, or
 | 
			
		||||
    nil if the set of dictionary keys is invalid, for example because
 | 
			
		||||
    a required key is missing, or a recognized key maps to an illegal
 | 
			
		||||
    value.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSHTTPCookie *)cookieWithProperties:(NSDictionary<NSHTTPCookiePropertyKey, id> *)properties;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @method requestHeaderFieldsWithCookies:
 | 
			
		||||
    @abstract Return a dictionary of header fields that can be used to add the
 | 
			
		||||
    specified cookies to the request.
 | 
			
		||||
    @param cookies The cookies to turn into request headers.
 | 
			
		||||
    @result An NSDictionary where the keys are header field names, and the values
 | 
			
		||||
    are the corresponding header field values.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSDictionary<NSString *, NSString *> *)requestHeaderFieldsWithCookies:(NSArray<NSHTTPCookie *> *)cookies;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @method cookiesWithResponseHeaderFields:forURL:
 | 
			
		||||
    @abstract Return an array of cookies parsed from the specified response header fields and URL.
 | 
			
		||||
    @param headerFields The response header fields to check for cookies.
 | 
			
		||||
    @param URL The URL that the cookies came from - relevant to how the cookies are interpeted.
 | 
			
		||||
    @result An NSArray of NSHTTPCookie objects
 | 
			
		||||
    @discussion This method will ignore irrelevant header fields so
 | 
			
		||||
    you can pass a dictionary containing data other than cookie data.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSArray<NSHTTPCookie *> *)cookiesWithResponseHeaderFields:(NSDictionary<NSString *, NSString *> *)headerFields forURL:(NSURL *)URL;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns a dictionary representation of the receiver.
 | 
			
		||||
    @discussion This method returns a dictionary representation of the
 | 
			
		||||
    NSHTTPCookie which can be saved and passed to
 | 
			
		||||
    <tt>-initWithProperties:</tt> or <tt>+cookieWithProperties:</tt>
 | 
			
		||||
    later to reconstitute an equivalent cookie.
 | 
			
		||||
    <p>See the NSHTTPCookie <tt>-initWithProperties:</tt> method for
 | 
			
		||||
    more information on the constraints imposed on the dictionary, and
 | 
			
		||||
    for descriptions of the supported keys and values.
 | 
			
		||||
    @result The dictionary representation of the receiver.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSDictionary<NSHTTPCookiePropertyKey, id> *properties;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns the version of the receiver.
 | 
			
		||||
    @discussion Version 0 maps to "old-style" Netscape cookies.
 | 
			
		||||
    Version 1 maps to RFC2965 cookies. There may be future versions.
 | 
			
		||||
    @result the version of the receiver.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSUInteger version;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns the name of the receiver.
 | 
			
		||||
    @result the name of the receiver.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSString *name;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns the value of the receiver.
 | 
			
		||||
    @result the value of the receiver.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSString *value;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns the expires date of the receiver.
 | 
			
		||||
    @result the expires date of the receiver.
 | 
			
		||||
    @discussion The expires date is the date when the cookie should be
 | 
			
		||||
    deleted. The result will be nil if there is no specific expires
 | 
			
		||||
    date. This will be the case only for "session-only" cookies.
 | 
			
		||||
    @result The expires date of the receiver.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSDate *expiresDate;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns whether the receiver is session-only.
 | 
			
		||||
    @result YES if this receiver should be discarded at the end of the
 | 
			
		||||
    session (regardless of expiration date), NO if receiver need not
 | 
			
		||||
    be discarded at the end of the session.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, getter=isSessionOnly) BOOL sessionOnly;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns the domain of the receiver.
 | 
			
		||||
    @discussion This value specifies URL domain to which the cookie
 | 
			
		||||
    should be sent. A domain with a leading dot means the cookie
 | 
			
		||||
    should be sent to subdomains as well, assuming certain other
 | 
			
		||||
    restrictions are valid. See RFC 2965 for more detail.
 | 
			
		||||
    @result The domain of the receiver.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSString *domain;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns the path of the receiver.
 | 
			
		||||
    @discussion This value specifies the URL path under the cookie's
 | 
			
		||||
    domain for which this cookie should be sent. The cookie will also
 | 
			
		||||
    be sent for children of that path, so "/" is the most general.
 | 
			
		||||
    @result The path of the receiver.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSString *path;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns whether the receiver should be sent only over
 | 
			
		||||
    secure channels
 | 
			
		||||
    @discussion Cookies may be marked secure by a server (or by a javascript).
 | 
			
		||||
    Cookies marked as such must only be sent via an encrypted connection to 
 | 
			
		||||
    trusted servers (i.e. via SSL or TLS), and should not be delievered to any
 | 
			
		||||
    javascript applications to prevent cross-site scripting vulnerabilities.
 | 
			
		||||
    @result YES if this cookie should be sent only over secure channels,
 | 
			
		||||
    NO otherwise.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, getter=isSecure) BOOL secure;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns whether the receiver should only be sent to HTTP servers
 | 
			
		||||
    per RFC 2965
 | 
			
		||||
    @discussion Cookies may be marked as HTTPOnly by a server (or by a javascript).
 | 
			
		||||
    Cookies marked as such must only be sent via HTTP Headers in HTTP Requests
 | 
			
		||||
    for URL's that match both the path and domain of the respective Cookies.
 | 
			
		||||
    Specifically these cookies should not be delivered to any javascript 
 | 
			
		||||
    applications to prevent cross-site scripting vulnerabilities.
 | 
			
		||||
    @result YES if this cookie should only be sent via HTTP headers,
 | 
			
		||||
    NO otherwise.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, getter=isHTTPOnly) BOOL HTTPOnly;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns the comment of the receiver.
 | 
			
		||||
    @discussion This value specifies a string which is suitable for
 | 
			
		||||
    presentation to the user explaining the contents and purpose of this
 | 
			
		||||
    cookie. It may be nil.
 | 
			
		||||
    @result The comment of the receiver, or nil if the receiver has no
 | 
			
		||||
    comment.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *comment;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns the comment URL of the receiver.
 | 
			
		||||
    @discussion This value specifies a URL which is suitable for
 | 
			
		||||
    presentation to the user as a link for further information about
 | 
			
		||||
    this cookie. It may be nil.
 | 
			
		||||
    @result The comment URL of the receiver, or nil if the receiver
 | 
			
		||||
    has no comment URL.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *commentURL;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Returns the list ports to which the receiver should be
 | 
			
		||||
    sent.
 | 
			
		||||
    @discussion This value specifies an NSArray of NSNumbers
 | 
			
		||||
    (containing integers) which specify the only ports to which this
 | 
			
		||||
    cookie should be sent.
 | 
			
		||||
    @result The list ports to which the receiver should be sent. The
 | 
			
		||||
    array may be nil, in which case this cookie can be sent to any
 | 
			
		||||
    port.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSNumber *> *portList;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 @abstract Returns the value of the same site attribute on the cookie.
 | 
			
		||||
 @discussion Cookies can be marked with an attribute Strict or Lax.
 | 
			
		||||
 Cookies marked with "strict" (NSHTTPCookieSameSiteStrict) are not sent along with cross-site requests.
 | 
			
		||||
 Cookies marked with "lax" (NSHTTPCookieSameSiteLax) sent along cross-site requests provided the
 | 
			
		||||
 cross-site requests are top-level-requests (one that changes the url in the address bar).
 | 
			
		||||
 The attribute value is canonicalized and stored. Any value other than the default (strict and lax) will be ignored.
 | 
			
		||||
 @result strict or lax. The result could also be nil, in which case the
 | 
			
		||||
 cookie will be sent along with all cross-site requests.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, readonly, copy) NSHTTPCookieStringPolicy sameSitePolicy API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,167 @@
 | 
			
		||||
/*	
 | 
			
		||||
    NSHTTPCookieStorage.h
 | 
			
		||||
    Copyright (c) 2003-2019, Apple Inc. All rights reserved.    
 | 
			
		||||
    
 | 
			
		||||
    Public header file.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>;
 | 
			
		||||
@class NSHTTPCookie;
 | 
			
		||||
@class NSURL;
 | 
			
		||||
@class NSDate;
 | 
			
		||||
@class NSURLSessionTask;
 | 
			
		||||
@class NSSortDescriptor;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @enum NSHTTPCookieAcceptPolicy
 | 
			
		||||
    @abstract Values for the different cookie accept policies
 | 
			
		||||
    @constant NSHTTPCookieAcceptPolicyAlways Accept all cookies
 | 
			
		||||
    @constant NSHTTPCookieAcceptPolicyNever Reject all cookies
 | 
			
		||||
    @constant NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain Accept cookies
 | 
			
		||||
    only from the main document domain
 | 
			
		||||
*/
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSHTTPCookieAcceptPolicy) {
 | 
			
		||||
    NSHTTPCookieAcceptPolicyAlways,
 | 
			
		||||
    NSHTTPCookieAcceptPolicyNever,
 | 
			
		||||
    NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@class NSHTTPCookieStorageInternal;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @class NSHTTPCookieStorage 
 | 
			
		||||
    @discussion NSHTTPCookieStorage implements a singleton object (shared
 | 
			
		||||
    instance) which manages the shared cookie store.  It has methods
 | 
			
		||||
    to allow clients to set and remove cookies, and get the current
 | 
			
		||||
    set of cookies.  It also has convenience methods to parse and
 | 
			
		||||
    generate cookie-related HTTP header fields.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSHTTPCookieStorage : NSObject
 | 
			
		||||
{
 | 
			
		||||
    @private
 | 
			
		||||
    NSHTTPCookieStorageInternal *_internal;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @property sharedHTTPCookieStorage
 | 
			
		||||
    @abstract Get the shared cookie storage in the default location.
 | 
			
		||||
    @result The shared cookie storage
 | 
			
		||||
    @discussion Starting in OS X 10.11, each app has its own sharedHTTPCookieStorage singleton, 
 | 
			
		||||
    which will not be shared with other applications.
 | 
			
		||||
*/
 | 
			
		||||
@property(class, readonly, strong) NSHTTPCookieStorage *sharedHTTPCookieStorage;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @method sharedCookieStorageForGroupContainerIdentifier:
 | 
			
		||||
    @abstract Get the cookie storage for the container associated with the specified application group identifier
 | 
			
		||||
    @param identifier The application group identifier
 | 
			
		||||
    @result A cookie storage with a persistent store in the application group container
 | 
			
		||||
    @discussion By default, applications and associated app extensions have different data containers, which means
 | 
			
		||||
    that the sharedHTTPCookieStorage singleton will refer to different persistent cookie stores in an application and
 | 
			
		||||
    any app extensions that it contains. This method allows clients to create a persistent cookie storage that can be
 | 
			
		||||
    shared among all applications and extensions with access to the same application group. Subsequent calls to this
 | 
			
		||||
    method with the same identifier will return the same cookie storage instance.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSHTTPCookieStorage *)sharedCookieStorageForGroupContainerIdentifier:(NSString *)identifier API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract Get all the cookies
 | 
			
		||||
    @result An NSArray of NSHTTPCookies
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable , readonly, copy) NSArray<NSHTTPCookie *> *cookies;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @method setCookie:
 | 
			
		||||
    @abstract Set a cookie
 | 
			
		||||
    @discussion The cookie will override an existing cookie with the
 | 
			
		||||
    same name, domain and path, if any.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setCookie:(NSHTTPCookie *)cookie;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @method deleteCookie:
 | 
			
		||||
    @abstract Delete the specified cookie
 | 
			
		||||
*/
 | 
			
		||||
- (void)deleteCookie:(NSHTTPCookie *)cookie;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 @method removeCookiesSince:
 | 
			
		||||
 @abstract Delete all cookies from the cookie storage since the provided date.
 | 
			
		||||
 */
 | 
			
		||||
- (void)removeCookiesSinceDate:(NSDate *)date API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @method cookiesForURL:
 | 
			
		||||
    @abstract Returns an array of cookies to send to the given URL.
 | 
			
		||||
    @param URL The URL for which to get cookies.
 | 
			
		||||
    @result an NSArray of NSHTTPCookie objects.
 | 
			
		||||
    @discussion The cookie manager examines the cookies it stores and
 | 
			
		||||
    includes those which should be sent to the given URL. You can use
 | 
			
		||||
    <tt>+[NSCookie requestHeaderFieldsWithCookies:]</tt> to turn this array
 | 
			
		||||
    into a set of header fields to add to a request.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSArray<NSHTTPCookie *> *)cookiesForURL:(NSURL *)URL;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @method setCookies:forURL:mainDocumentURL:
 | 
			
		||||
    @abstract Adds an array cookies to the cookie store, following the
 | 
			
		||||
    cookie accept policy.
 | 
			
		||||
    @param cookies The cookies to set.
 | 
			
		||||
    @param URL The URL from which the cookies were sent.
 | 
			
		||||
    @param mainDocumentURL The main document URL to be used as a base for the "same
 | 
			
		||||
    domain as main document" policy.
 | 
			
		||||
    @discussion For mainDocumentURL, the caller should pass the URL for
 | 
			
		||||
    an appropriate main document, if known. For example, when loading
 | 
			
		||||
    a web page, the URL of the main html document for the top-level
 | 
			
		||||
    frame should be passed. To save cookies based on a set of response
 | 
			
		||||
    headers, you can use <tt>+[NSCookie
 | 
			
		||||
    cookiesWithResponseHeaderFields:forURL:]</tt> on a header field
 | 
			
		||||
    dictionary and then use this method to store the resulting cookies
 | 
			
		||||
    in accordance with policy settings.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setCookies:(NSArray<NSHTTPCookie *> *)cookies forURL:(nullable NSURL *)URL mainDocumentURL:(nullable NSURL *)mainDocumentURL;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @abstract The cookie accept policy preference of the
 | 
			
		||||
    receiver.
 | 
			
		||||
*/
 | 
			
		||||
@property NSHTTPCookieAcceptPolicy cookieAcceptPolicy;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
  @method sortedCookiesUsingDescriptors:
 | 
			
		||||
  @abstract Returns an array of all cookies in the store, sorted according to the key value and sorting direction of the NSSortDescriptors specified in the parameter.
 | 
			
		||||
  @param sortOrder an array of NSSortDescriptors which represent the preferred sort order of the resulting array.
 | 
			
		||||
  @discussion proper sorting of cookies may require extensive string conversion, which can be avoided by allowing the system to perform the sorting.  This API is to be preferred over the more generic -[NSHTTPCookieStorage cookies] API, if sorting is going to be performed.
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray<NSHTTPCookie *> *)sortedCookiesUsingDescriptors:(NSArray<NSSortDescriptor *> *) sortOrder API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSHTTPCookieStorage (NSURLSessionTaskAdditions)
 | 
			
		||||
- (void)storeCookies:(NSArray<NSHTTPCookie *> *)cookies forTask:(NSURLSessionTask *)task API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)getCookiesForTask:(NSURLSessionTask *)task completionHandler:(void (^) (NSArray<NSHTTPCookie *> * _Nullable cookies))completionHandler API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieManagerAcceptPolicyChangedNotification
 | 
			
		||||
    @discussion Name of notification that should be posted to the
 | 
			
		||||
    distributed notification center whenever the accept cookies
 | 
			
		||||
    preference is changed
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSHTTPCookieManagerAcceptPolicyChangedNotification API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
    @const NSHTTPCookieManagerCookiesChangedNotification
 | 
			
		||||
    @abstract Notification sent when the set of cookies changes
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSHTTPCookieManagerCookiesChangedNotification API_AVAILABLE(macos(10.2), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,117 @@
 | 
			
		||||
/*	NSHashTable.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSPointerFunctions.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <Foundation/NSEnumerator.h>
 | 
			
		||||
 | 
			
		||||
#if !defined(__FOUNDATION_NSHASHTABLE__)
 | 
			
		||||
#define __FOUNDATION_NSHASHTABLE__ 1
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>, NSSet<ObjectType>, NSHashTable;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* An NSHashTable is modeled after a set, although, because of its options, is not a set because it can behave differently (for example, if pointer equality is specified two isEqual strings will both be entered).  The major option is to provide for "weak" references that are removed automatically, but at some indefinite point in the future.
 | 
			
		||||
   An NSHashTable can also be configured to operate on arbitrary pointers and not just objects.  We recommend the C function API for "void *" access.  To configure for pointer use, consult and choose the appropriate NSPointerFunctionsOptions or configure or use an NSPointerFunctions object itself for initialization.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
static const NSPointerFunctionsOptions NSHashTableStrongMemory API_AVAILABLE(macos(10.5), ios(6.0), watchos(2.0), tvos(9.0)) = NSPointerFunctionsStrongMemory;
 | 
			
		||||
static const NSPointerFunctionsOptions NSHashTableZeroingWeakMemory API_DEPRECATED("GC no longer supported", macos(10.5,10.8)) API_UNAVAILABLE(ios, watchos, tvos) = NSPointerFunctionsZeroingWeakMemory;
 | 
			
		||||
static const NSPointerFunctionsOptions NSHashTableCopyIn API_AVAILABLE(macos(10.5), ios(6.0), watchos(2.0), tvos(9.0)) = NSPointerFunctionsCopyIn;
 | 
			
		||||
static const NSPointerFunctionsOptions NSHashTableObjectPointerPersonality API_AVAILABLE(macos(10.5), ios(6.0), watchos(2.0), tvos(9.0)) = NSPointerFunctionsObjectPointerPersonality;
 | 
			
		||||
static const NSPointerFunctionsOptions NSHashTableWeakMemory API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)) = NSPointerFunctionsWeakMemory;
 | 
			
		||||
 | 
			
		||||
typedef NSUInteger NSHashTableOptions;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5), ios(6.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSHashTable<ObjectType> : NSObject <NSCopying, NSSecureCoding, NSFastEnumeration>
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithOptions:(NSPointerFunctionsOptions)options capacity:(NSUInteger)initialCapacity NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithPointerFunctions:(NSPointerFunctions *)functions capacity:(NSUInteger)initialCapacity NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
// conveniences
 | 
			
		||||
 | 
			
		||||
+ (NSHashTable<ObjectType> *)hashTableWithOptions:(NSPointerFunctionsOptions)options;
 | 
			
		||||
 | 
			
		||||
+ (id)hashTableWithWeakObjects API_DEPRECATED("GC no longer supported", macos(10.5,10.8)) API_UNAVAILABLE(ios, watchos, tvos);  // GC zeroing, otherwise unsafe unretained
 | 
			
		||||
 | 
			
		||||
+ (NSHashTable<ObjectType> *)weakObjectsHashTable API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)); // entries are not necessarily purged right away when the weak object is reclaimed
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* return an NSPointerFunctions object reflecting the functions in use.  This is a new autoreleased object that can be subsequently modified and/or used directly in the creation of other pointer "collections". */
 | 
			
		||||
@property (readonly, copy) NSPointerFunctions *pointerFunctions;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger count;
 | 
			
		||||
- (nullable ObjectType)member:(nullable ObjectType)object;
 | 
			
		||||
- (NSEnumerator<ObjectType> *)objectEnumerator;
 | 
			
		||||
 | 
			
		||||
- (void)addObject:(nullable ObjectType)object;
 | 
			
		||||
- (void)removeObject:(nullable ObjectType)object;
 | 
			
		||||
 | 
			
		||||
- (void)removeAllObjects;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<ObjectType> *allObjects;    // convenience
 | 
			
		||||
 | 
			
		||||
@property (nullable, nonatomic, readonly) ObjectType anyObject;
 | 
			
		||||
- (BOOL)containsObject:(nullable ObjectType)anObject;
 | 
			
		||||
 | 
			
		||||
- (BOOL)intersectsHashTable:(NSHashTable<ObjectType> *)other;
 | 
			
		||||
- (BOOL)isEqualToHashTable:(NSHashTable<ObjectType> *)other;
 | 
			
		||||
- (BOOL)isSubsetOfHashTable:(NSHashTable<ObjectType> *)other;
 | 
			
		||||
 | 
			
		||||
- (void)intersectHashTable:(NSHashTable<ObjectType> *)other;
 | 
			
		||||
- (void)unionHashTable:(NSHashTable<ObjectType> *)other;
 | 
			
		||||
- (void)minusHashTable:(NSHashTable<ObjectType> *)other;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSSet<ObjectType> *setRepresentation;  // create a set of the contents
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/****************	(void *) Hash table operations	****************/
 | 
			
		||||
 | 
			
		||||
typedef struct {NSUInteger _pi; NSUInteger _si; void * _Nullable _bs;} NSHashEnumerator;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT void NSFreeHashTable(NSHashTable *table);
 | 
			
		||||
FOUNDATION_EXPORT void NSResetHashTable(NSHashTable *table);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSCompareHashTables(NSHashTable *table1, NSHashTable *table2);
 | 
			
		||||
FOUNDATION_EXPORT NSHashTable *NSCopyHashTableWithZone(NSHashTable *table, NSZone * _Nullable zone);
 | 
			
		||||
FOUNDATION_EXPORT void *NSHashGet(NSHashTable *table, const void * _Nullable pointer);
 | 
			
		||||
FOUNDATION_EXPORT void NSHashInsert(NSHashTable *table, const void * _Nullable pointer);
 | 
			
		||||
FOUNDATION_EXPORT void NSHashInsertKnownAbsent(NSHashTable *table, const void * _Nullable pointer);
 | 
			
		||||
FOUNDATION_EXPORT void * _Nullable NSHashInsertIfAbsent(NSHashTable *table, const void * _Nullable pointer);
 | 
			
		||||
FOUNDATION_EXPORT void NSHashRemove(NSHashTable *table, const void * _Nullable pointer);
 | 
			
		||||
FOUNDATION_EXPORT NSHashEnumerator NSEnumerateHashTable(NSHashTable *table);
 | 
			
		||||
FOUNDATION_EXPORT void * _Nullable NSNextHashEnumeratorItem(NSHashEnumerator *enumerator);
 | 
			
		||||
FOUNDATION_EXPORT void NSEndHashTableEnumeration(NSHashEnumerator *enumerator);
 | 
			
		||||
FOUNDATION_EXPORT NSUInteger NSCountHashTable(NSHashTable *table);
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSStringFromHashTable(NSHashTable *table);
 | 
			
		||||
FOUNDATION_EXPORT NSArray *NSAllHashTableObjects(NSHashTable *table);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/****************	Legacy	****************/
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    NSUInteger	(* _Nullable hash)(NSHashTable *table, const void *);
 | 
			
		||||
    BOOL	(* _Nullable isEqual)(NSHashTable *table, const void *, const void *);
 | 
			
		||||
    void	(* _Nullable retain)(NSHashTable *table, const void *);
 | 
			
		||||
    void	(* _Nullable release)(NSHashTable *table, void *);
 | 
			
		||||
    NSString 	* _Nullable (* _Nullable describe)(NSHashTable *table, const void *);
 | 
			
		||||
} NSHashTableCallBacks;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSHashTable *NSCreateHashTableWithZone(NSHashTableCallBacks callBacks, NSUInteger capacity, NSZone * _Nullable zone);
 | 
			
		||||
FOUNDATION_EXPORT NSHashTable *NSCreateHashTable(NSHashTableCallBacks callBacks, NSUInteger capacity);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT const NSHashTableCallBacks NSIntegerHashCallBacks API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
FOUNDATION_EXPORT const NSHashTableCallBacks NSNonOwnedPointerHashCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSHashTableCallBacks NSNonRetainedObjectHashCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSHashTableCallBacks NSObjectHashCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSHashTableCallBacks NSOwnedObjectIdentityHashCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSHashTableCallBacks NSOwnedPointerHashCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSHashTableCallBacks NSPointerToStructHashCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSHashTableCallBacks NSIntHashCallBacks API_DEPRECATED("Not supported", macos(10.0,10.5)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
#endif // defined __FOUNDATION_NSHASHTABLE__
 | 
			
		||||
@@ -0,0 +1,48 @@
 | 
			
		||||
/*	NSHost.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSArray<ObjectType>, NSMutableArray;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * DEPRECATION NOTICE
 | 
			
		||||
 *
 | 
			
		||||
 * If you’re using `NSHost` to resolve DNS names so that you can connect to a
 | 
			
		||||
 * service, switch to a connect-by-name API, for example, `nw_connection`.
 | 
			
		||||
 *
 | 
			
		||||
 * If you have other DNS resolution needs, switch to <dns_sd.h>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use Network framework instead, see deprecation notice in <Foundation/NSHost.h>", macos(10.0, API_TO_BE_DEPRECATED)) API_UNAVAILABLE(ios, watchos, tvos)
 | 
			
		||||
@interface NSHost : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    NSArray 	*names;
 | 
			
		||||
    NSArray 	*addresses;
 | 
			
		||||
    id		reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
+ (instancetype)currentHost;
 | 
			
		||||
+ (instancetype)hostWithName:(nullable NSString *)name;
 | 
			
		||||
+ (instancetype)hostWithAddress:(NSString *)address;
 | 
			
		||||
 | 
			
		||||
- (BOOL)isEqualToHost:(NSHost *)aHost;
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSString *name;	// arbitrary choice
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *names;	// unordered list
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSString *address;	// arbitrary choice
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *addresses;	// unordered list of IPv6 and IPv4 addresses
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSString *localizedName API_AVAILABLE(macos(10.6)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
// NSHost does not implement any caching any longer
 | 
			
		||||
+ (void)setHostCacheEnabled:(BOOL)flag API_DEPRECATED("Caching no longer supported", macos(10.0,10.7)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
+ (BOOL)isHostCacheEnabled API_DEPRECATED("Caching no longer supported", macos(10.0,10.7)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
+ (void)flushHostCache API_DEPRECATED("Caching no longer supported", macos(10.0,10.7)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,70 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSISO8601DateFormatter.h
 | 
			
		||||
    Copyright (c) 2015-2019, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <CoreFoundation/CFDateFormatter.h>
 | 
			
		||||
#import <Foundation/NSFormatter.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@class NSString, NSDate, NSTimeZone;
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSISO8601DateFormatOptions) {
 | 
			
		||||
    /* The format for year is inferred based on whether or not the week of year option is specified.
 | 
			
		||||
     - if week of year is present, "YYYY" is used to display week dates.
 | 
			
		||||
     - if week of year is not present, "yyyy" is used by default.
 | 
			
		||||
     */
 | 
			
		||||
    NSISO8601DateFormatWithYear API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithYear,
 | 
			
		||||
    NSISO8601DateFormatWithMonth API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithMonth,
 | 
			
		||||
 | 
			
		||||
    NSISO8601DateFormatWithWeekOfYear API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithWeekOfYear,  // This includes the "W" prefix (e.g. "W49")
 | 
			
		||||
 | 
			
		||||
    /* The format for day is inferred based on provided options.
 | 
			
		||||
     - if month is not present, day of year ("DDD") is used.
 | 
			
		||||
     - if month is present, day of month ("dd") is used.
 | 
			
		||||
     - if either weekOfMonth or weekOfYear is present, local day of week ("ee") is used.
 | 
			
		||||
     */
 | 
			
		||||
    NSISO8601DateFormatWithDay API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithDay,
 | 
			
		||||
 | 
			
		||||
    NSISO8601DateFormatWithTime API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithTime,  // This uses the format "HHmmss"
 | 
			
		||||
    NSISO8601DateFormatWithTimeZone API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithTimeZone,
 | 
			
		||||
 | 
			
		||||
    NSISO8601DateFormatWithSpaceBetweenDateAndTime API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithSpaceBetweenDateAndTime,  // Use space instead of "T"
 | 
			
		||||
    NSISO8601DateFormatWithDashSeparatorInDate API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithDashSeparatorInDate,  // Add separator for date ("-")
 | 
			
		||||
    NSISO8601DateFormatWithColonSeparatorInTime API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithColonSeparatorInTime,  // Add separator for time (":")
 | 
			
		||||
    NSISO8601DateFormatWithColonSeparatorInTimeZone API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithColonSeparatorInTimeZone,  // Add ":" separator in timezone (e.g. +08:00)
 | 
			
		||||
    NSISO8601DateFormatWithFractionalSeconds API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0)) = kCFISO8601DateFormatWithFractionalSeconds,  // Add 3 significant digits of fractional seconds (".SSS")
 | 
			
		||||
 | 
			
		||||
    NSISO8601DateFormatWithFullDate API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithFullDate,
 | 
			
		||||
    NSISO8601DateFormatWithFullTime API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithFullTime,
 | 
			
		||||
 | 
			
		||||
    NSISO8601DateFormatWithInternetDateTime API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = kCFISO8601DateFormatWithInternetDateTime,  // RFC 3339
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0))
 | 
			
		||||
@interface NSISO8601DateFormatter : NSFormatter <NSSecureCoding> {
 | 
			
		||||
@private
 | 
			
		||||
    CFDateFormatterRef _formatter;
 | 
			
		||||
    NSTimeZone *_timeZone;
 | 
			
		||||
    NSISO8601DateFormatOptions _formatOptions;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Please note that there can be a significant performance cost when resetting these properties.  Resetting each property can result in regenerating the entire CFDateFormatterRef, which can be very expensive. */
 | 
			
		||||
@property (null_resettable, copy) NSTimeZone *timeZone;  // The default time zone is GMT.
 | 
			
		||||
 | 
			
		||||
@property NSISO8601DateFormatOptions formatOptions;
 | 
			
		||||
 | 
			
		||||
/* This init method creates a formatter object set to the GMT time zone and preconfigured with the RFC 3339 standard format ("yyyy-MM-dd'T'HH:mm:ssXXXXX") using the following options:
 | 
			
		||||
 NSISO8601DateFormatWithInternetDateTime | NSISO8601DateFormatWithDashSeparatorInDate | NSISO8601DateFormatWithColonSeparatorInTime | NSISO8601DateFormatWithColonSeparatorInTimeZone
 | 
			
		||||
 */
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (NSString *)stringFromDate:(NSDate *)date;
 | 
			
		||||
- (nullable NSDate *)dateFromString:(NSString *)string;
 | 
			
		||||
 | 
			
		||||
+ (NSString *)stringFromDate:(NSDate *)date timeZone:(NSTimeZone *)timeZone formatOptions:(NSISO8601DateFormatOptions)formatOptions;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,53 @@
 | 
			
		||||
/*  NSIndexPath.h
 | 
			
		||||
    Copyright (c) 2003-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSRange.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSIndexPath : NSObject <NSCopying, NSSecureCoding> {
 | 
			
		||||
	@private
 | 
			
		||||
	NSUInteger *_indexes;
 | 
			
		||||
#if !__OBJC2__
 | 
			
		||||
	NSUInteger _hash;
 | 
			
		||||
#endif
 | 
			
		||||
	NSUInteger _length;
 | 
			
		||||
        void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
+ (instancetype)indexPathWithIndex:(NSUInteger)index;
 | 
			
		||||
+ (instancetype)indexPathWithIndexes:(const NSUInteger [_Nullable])indexes length:(NSUInteger)length;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithIndexes:(const NSUInteger [_Nullable])indexes length:(NSUInteger)length NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithIndex:(NSUInteger)index;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (NSIndexPath *)indexPathByAddingIndex:(NSUInteger)index;
 | 
			
		||||
- (NSIndexPath *)indexPathByRemovingLastIndex;
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)indexAtPosition:(NSUInteger)position;
 | 
			
		||||
@property (readonly) NSUInteger length;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 @abstract Copies the indexes stored in this index path from the positions specified by positionRange into indexes.
 | 
			
		||||
 @param indexes Buffer of at least as many NSUIntegers as specified by the length of positionRange. On return, this memory will hold the index path's indexes.
 | 
			
		||||
 @param positionRange A range of valid positions within this index path.  If the location plus the length of positionRange is greater than the length of this index path, this method raises an NSRangeException.
 | 
			
		||||
 @discussion
 | 
			
		||||
    It is the developer’s responsibility to allocate the memory for the C array.
 | 
			
		||||
 */
 | 
			
		||||
- (void)getIndexes:(NSUInteger *)indexes range:(NSRange)positionRange API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
	// comparison support
 | 
			
		||||
- (NSComparisonResult)compare:(NSIndexPath *)otherObject; // sorting an array of indexPaths using this comparison results in an array representing nodes in depth-first traversal order
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSIndexPath (NSDeprecated)
 | 
			
		||||
/// This method is unsafe because it could potentially cause buffer overruns. You should use -getIndexes:range: instead. 
 | 
			
		||||
- (void)getIndexes:(NSUInteger *)indexes API_DEPRECATED_WITH_REPLACEMENT("getIndexes:range:", macos(10.0, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED)); // use -getIndexes:range: instead
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,126 @@
 | 
			
		||||
/*	NSIndexSet.h
 | 
			
		||||
	Copyright (c) 2002-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Class for managing set of indexes. The set of valid indexes are 0 .. NSNotFound - 1; trying to use indexes outside this range is an error.  NSIndexSet uses NSNotFound as a return value in cases where the queried index doesn't exist in the set; for instance, when you ask firstIndex and there are no indexes; or when you ask for indexGreaterThanIndex: on the last index, and so on.
 | 
			
		||||
 | 
			
		||||
The following code snippets can be used to enumerate over the indexes in an NSIndexSet:
 | 
			
		||||
 | 
			
		||||
    // Forward
 | 
			
		||||
    NSUInteger currentIndex = [set firstIndex];
 | 
			
		||||
    while (currentIndex != NSNotFound) {
 | 
			
		||||
        ...
 | 
			
		||||
        currentIndex = [set indexGreaterThanIndex:currentIndex];
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    // Backward
 | 
			
		||||
    NSUInteger currentIndex = [set lastIndex];
 | 
			
		||||
    while (currentIndex != NSNotFound) {
 | 
			
		||||
        ...
 | 
			
		||||
        currentIndex = [set indexLessThanIndex:currentIndex];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
To enumerate without doing a call per index, you can use the method getIndexes:maxCount:inIndexRange:.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSRange.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSIndexSet : NSObject <NSCopying, NSMutableCopying, NSSecureCoding> {
 | 
			
		||||
    @protected   // all instance variables are private
 | 
			
		||||
    struct {
 | 
			
		||||
        NSUInteger _isEmpty:1;
 | 
			
		||||
        NSUInteger _hasSingleRange:1;
 | 
			
		||||
        NSUInteger _cacheValid:1;
 | 
			
		||||
        NSUInteger _reservedArrayBinderController:29;
 | 
			
		||||
    } _indexSetFlags;
 | 
			
		||||
    union {
 | 
			
		||||
        struct {
 | 
			
		||||
            NSRange _range;
 | 
			
		||||
        } _singleRange;
 | 
			
		||||
        struct {
 | 
			
		||||
            void * _data;
 | 
			
		||||
            void *_reserved;
 | 
			
		||||
        } _multipleRanges;
 | 
			
		||||
    } _internal;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
+ (instancetype)indexSet;
 | 
			
		||||
+ (instancetype)indexSetWithIndex:(NSUInteger)value;
 | 
			
		||||
+ (instancetype)indexSetWithIndexesInRange:(NSRange)range;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithIndexesInRange:(NSRange)range NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithIndexSet:(NSIndexSet *)indexSet NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithIndex:(NSUInteger)value;
 | 
			
		||||
 | 
			
		||||
- (BOOL)isEqualToIndexSet:(NSIndexSet *)indexSet;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger count;
 | 
			
		||||
 | 
			
		||||
/* The following six methods will return NSNotFound if there is no index in the set satisfying the query. 
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSUInteger firstIndex;
 | 
			
		||||
@property (readonly) NSUInteger lastIndex;
 | 
			
		||||
- (NSUInteger)indexGreaterThanIndex:(NSUInteger)value;
 | 
			
		||||
- (NSUInteger)indexLessThanIndex:(NSUInteger)value;
 | 
			
		||||
- (NSUInteger)indexGreaterThanOrEqualToIndex:(NSUInteger)value;
 | 
			
		||||
- (NSUInteger)indexLessThanOrEqualToIndex:(NSUInteger)value;
 | 
			
		||||
 | 
			
		||||
/* Fills up to bufferSize indexes in the specified range into the buffer and returns the number of indexes actually placed in the buffer; also modifies the optional range passed in by pointer to be "positioned" after the last index filled into the buffer.Example: if the index set contains the indexes 0, 2, 4, ..., 98, 100, for a buffer of size 10 and the range (20, 80) the buffer would contain 20, 22, ..., 38 and the range would be modified to (40, 60).
 | 
			
		||||
*/
 | 
			
		||||
- (NSUInteger)getIndexes:(NSUInteger *)indexBuffer maxCount:(NSUInteger)bufferSize inIndexRange:(nullable NSRangePointer)range;
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)countOfIndexesInRange:(NSRange)range API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (BOOL)containsIndex:(NSUInteger)value;
 | 
			
		||||
- (BOOL)containsIndexesInRange:(NSRange)range;
 | 
			
		||||
- (BOOL)containsIndexes:(NSIndexSet *)indexSet;
 | 
			
		||||
 | 
			
		||||
- (BOOL)intersectsIndexesInRange:(NSRange)range;
 | 
			
		||||
 | 
			
		||||
- (void)enumerateIndexesUsingBlock:(void (NS_NOESCAPE ^)(NSUInteger idx, BOOL *stop))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)enumerateIndexesWithOptions:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSUInteger idx, BOOL *stop))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)enumerateIndexesInRange:(NSRange)range options:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSUInteger idx, BOOL *stop))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)indexPassingTest:(BOOL (NS_NOESCAPE ^)(NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSUInteger)indexWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSUInteger)indexInRange:(NSRange)range options:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (NSIndexSet *)indexesPassingTest:(BOOL (NS_NOESCAPE ^)(NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSIndexSet *)indexesWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSIndexSet *)indexesInRange:(NSRange)range options:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(NSUInteger idx, BOOL *stop))predicate API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 The following three convenience methods allow you to enumerate the indexes in the receiver by ranges of contiguous indexes. The performance of these methods is not guaranteed to be any better than if they were implemented with enumerateIndexesInRange:options:usingBlock:. However, depending on the receiver's implementation, they may perform better than that.
 | 
			
		||||
 
 | 
			
		||||
 If the specified range for enumeration intersects a range of contiguous indexes in the receiver, then the block will be invoked with the intersection of those two ranges.
 | 
			
		||||
*/
 | 
			
		||||
- (void)enumerateRangesUsingBlock:(void (NS_NOESCAPE ^)(NSRange range, BOOL *stop))block API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)enumerateRangesWithOptions:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSRange range, BOOL *stop))block API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)enumerateRangesInRange:(NSRange)range options:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSRange range, BOOL *stop))block API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableIndexSet : NSIndexSet {
 | 
			
		||||
    @protected
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (void)addIndexes:(NSIndexSet *)indexSet;
 | 
			
		||||
- (void)removeIndexes:(NSIndexSet *)indexSet;
 | 
			
		||||
- (void)removeAllIndexes;
 | 
			
		||||
- (void)addIndex:(NSUInteger)value;
 | 
			
		||||
- (void)removeIndex:(NSUInteger)value;
 | 
			
		||||
- (void)addIndexesInRange:(NSRange)range;
 | 
			
		||||
- (void)removeIndexesInRange:(NSRange)range;
 | 
			
		||||
 | 
			
		||||
/* For a positive delta, shifts the indexes in [index, INT_MAX] to the right, thereby inserting an "empty space" [index, delta], for a negative delta, shifts the indexes in [index, INT_MAX] to the left, thereby deleting the indexes in the range [index - delta, delta].
 | 
			
		||||
*/
 | 
			
		||||
- (void)shiftIndexesStartingAtIndex:(NSUInteger)index by:(NSInteger)delta;   
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,44 @@
 | 
			
		||||
/*    NSMorphology.h
 | 
			
		||||
      Copyright (c) 2021, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSMorphology;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
 | 
			
		||||
NS_REFINED_FOR_SWIFT
 | 
			
		||||
@interface NSInflectionRule: NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
- (id)init NS_UNAVAILABLE; // This class is abstract. Use +automaticRule, or instantiate a subclass instead.
 | 
			
		||||
 | 
			
		||||
@property (class, readonly) NSInflectionRule *automaticRule;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
 | 
			
		||||
NS_REFINED_FOR_SWIFT
 | 
			
		||||
@interface NSInflectionRuleExplicit: NSInflectionRule
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithMorphology:(NSMorphology *)morphology NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
@property (readonly, copy) NSMorphology *morphology;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// -----
 | 
			
		||||
 | 
			
		||||
@interface NSInflectionRule (NSInflectionAvailability)
 | 
			
		||||
 | 
			
		||||
// Whether inflection will work in the specified language code.
 | 
			
		||||
+ (BOOL)canInflectLanguage:(NSString *)language
 | 
			
		||||
 API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
// Whether inflection will work in the language of the main bundle's first preferred localization.
 | 
			
		||||
@property (class, readonly) BOOL canInflectPreferredLocalization
 | 
			
		||||
 API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,81 @@
 | 
			
		||||
/*	NSInvocation.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#include <stdbool.h>
 | 
			
		||||
 | 
			
		||||
@class NSMethodSignature;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("NSInvocation and related APIs not available")
 | 
			
		||||
@interface NSInvocation : NSObject
 | 
			
		||||
 | 
			
		||||
+ (NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)sig;
 | 
			
		||||
 | 
			
		||||
@property (readonly, retain) NSMethodSignature *methodSignature;
 | 
			
		||||
 | 
			
		||||
- (void)retainArguments;
 | 
			
		||||
@property (readonly) BOOL argumentsRetained;
 | 
			
		||||
 | 
			
		||||
@property (nullable, assign) id target;
 | 
			
		||||
@property SEL selector;
 | 
			
		||||
 | 
			
		||||
- (void)getReturnValue:(void *)retLoc;
 | 
			
		||||
- (void)setReturnValue:(void *)retLoc;
 | 
			
		||||
 | 
			
		||||
- (void)getArgument:(void *)argumentLocation atIndex:(NSInteger)idx;
 | 
			
		||||
- (void)setArgument:(void *)argumentLocation atIndex:(NSInteger)idx;
 | 
			
		||||
 | 
			
		||||
- (void)invoke;
 | 
			
		||||
- (void)invokeWithTarget:(id)target;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
 | 
			
		||||
 | 
			
		||||
enum _NSObjCValueType {
 | 
			
		||||
    NSObjCNoType = 0,
 | 
			
		||||
    NSObjCVoidType = 'v',
 | 
			
		||||
    NSObjCCharType = 'c',
 | 
			
		||||
    NSObjCShortType = 's',
 | 
			
		||||
    NSObjCLongType = 'l',
 | 
			
		||||
    NSObjCLonglongType = 'q',
 | 
			
		||||
    NSObjCFloatType = 'f',
 | 
			
		||||
    NSObjCDoubleType = 'd',
 | 
			
		||||
    NSObjCBoolType = 'B',
 | 
			
		||||
    NSObjCSelectorType = ':',
 | 
			
		||||
    NSObjCObjectType = '@',
 | 
			
		||||
    NSObjCStructType = '{',
 | 
			
		||||
    NSObjCPointerType = '^',
 | 
			
		||||
    NSObjCStringType = '*',
 | 
			
		||||
    NSObjCArrayType = '[',
 | 
			
		||||
    NSObjCUnionType = '(',
 | 
			
		||||
    NSObjCBitfield = 'b'
 | 
			
		||||
} API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    NSInteger type API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
    union {
 | 
			
		||||
    	char charValue;
 | 
			
		||||
	short shortValue;
 | 
			
		||||
	long longValue;
 | 
			
		||||
	long long longlongValue;
 | 
			
		||||
	float floatValue;
 | 
			
		||||
	double doubleValue;
 | 
			
		||||
	bool boolValue;
 | 
			
		||||
	SEL selectorValue;
 | 
			
		||||
	id objectValue;
 | 
			
		||||
	void *pointerValue;
 | 
			
		||||
	void *structLocation;
 | 
			
		||||
	char *cStringLocation;
 | 
			
		||||
    } value API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
} NSObjCValue API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,255 @@
 | 
			
		||||
/*	NSItemProvider.h
 | 
			
		||||
        Copyright (c) 2013-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if __OBJC2__
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@class NSItemProvider, NSProgress;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSItemProviderRepresentationVisibility) {
 | 
			
		||||
    NSItemProviderRepresentationVisibilityAll = 0,                                  // All processes can see this representation
 | 
			
		||||
    NSItemProviderRepresentationVisibilityTeam                                      // Only processes from the same dev team can see this representation
 | 
			
		||||
    API_AVAILABLE(ios(11.0), watchos(4.0), tvos(11.0)) API_UNAVAILABLE(macos) = 1,
 | 
			
		||||
    NSItemProviderRepresentationVisibilityGroup                                     // Only processes from the same group can see this representation
 | 
			
		||||
    API_AVAILABLE(macos(10.13)) API_UNAVAILABLE(ios, watchos, tvos) = 2 ,
 | 
			
		||||
    NSItemProviderRepresentationVisibilityOwnProcess = 3,                           // Ony the originator's process can see this representation
 | 
			
		||||
} API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// The default behavior is to copy files.
 | 
			
		||||
typedef NS_OPTIONS(NSInteger, NSItemProviderFileOptions) {
 | 
			
		||||
    NSItemProviderFileOptionOpenInPlace = 1,
 | 
			
		||||
} API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This protocol allows a class to export its data to a variety of binary representations.
 | 
			
		||||
API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0))
 | 
			
		||||
@protocol NSItemProviderWriting <NSObject>
 | 
			
		||||
 | 
			
		||||
@property (class, NS_NONATOMIC_IOSONLY, readonly, copy) NSArray<NSString *> *writableTypeIdentifiersForItemProvider;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
// If this method is not implemented, the class method will be consulted instead.
 | 
			
		||||
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray<NSString *> *writableTypeIdentifiersForItemProvider;
 | 
			
		||||
 | 
			
		||||
+ (NSItemProviderRepresentationVisibility)itemProviderVisibilityForRepresentationWithTypeIdentifier:(NSString *)typeIdentifier;
 | 
			
		||||
 | 
			
		||||
// If this method is not implemented, the class method will be consulted instead.
 | 
			
		||||
- (NSItemProviderRepresentationVisibility)itemProviderVisibilityForRepresentationWithTypeIdentifier:(NSString *)typeIdentifier;
 | 
			
		||||
 | 
			
		||||
@required
 | 
			
		||||
 | 
			
		||||
- (nullable NSProgress *)loadDataWithTypeIdentifier:(NSString *)typeIdentifier // One of writableTypeIdentifiersForItemProvider
 | 
			
		||||
                   forItemProviderCompletionHandler:(void (^)(NSData * _Nullable data, NSError * _Nullable error))completionHandler;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// This protocol allows a class to be constructed from a variety of binary representations.
 | 
			
		||||
API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0))
 | 
			
		||||
@protocol NSItemProviderReading <NSObject>
 | 
			
		||||
 | 
			
		||||
@property (class, NS_NONATOMIC_IOSONLY, readonly, copy) NSArray<NSString *> *readableTypeIdentifiersForItemProvider;
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)objectWithItemProviderData:(NSData *)data
 | 
			
		||||
                                     typeIdentifier:(NSString *)typeIdentifier
 | 
			
		||||
                                              error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef void (^NSItemProviderCompletionHandler)(__nullable __kindof id <NSSecureCoding> item, NSError * __null_unspecified error);
 | 
			
		||||
typedef void (^NSItemProviderLoadHandler)(__null_unspecified NSItemProviderCompletionHandler completionHandler, __null_unspecified Class expectedValueClass, NSDictionary * __null_unspecified options);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// An NSItemProvider is a high level abstraction for an item supporting multiple representations.
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSItemProvider : NSObject <NSCopying>
 | 
			
		||||
 | 
			
		||||
#pragma mark - Binary interface
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark Provider
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
// Register higher-fidelity types first, followed by progressively lower-fidelity ones. This ordering helps consumers get the best representation they can handle.
 | 
			
		||||
 | 
			
		||||
// Registers a data-backed representation.
 | 
			
		||||
- (void)registerDataRepresentationForTypeIdentifier:(NSString *)typeIdentifier
 | 
			
		||||
                                         visibility:(NSItemProviderRepresentationVisibility)visibility
 | 
			
		||||
                                        loadHandler:(NSProgress * _Nullable (^)(void (^completionHandler)(NSData * _Nullable data, NSError * _Nullable error)))loadHandler API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
// Registers a file-backed representation.
 | 
			
		||||
// Set `coordinated` to YES if the returned file must be accessed using NSFileCoordinator.
 | 
			
		||||
// If `NSItemProviderFileOptionOpenInPlace` is not provided, the file provided will be copied before the load handler returns.
 | 
			
		||||
- (void)registerFileRepresentationForTypeIdentifier:(NSString *)typeIdentifier
 | 
			
		||||
                                        fileOptions:(NSItemProviderFileOptions)fileOptions
 | 
			
		||||
                                         visibility:(NSItemProviderRepresentationVisibility)visibility
 | 
			
		||||
                                        loadHandler:(NSProgress * _Nullable (^)(void (^completionHandler)(NSURL * _Nullable url, BOOL coordinated, NSError * _Nullable error)))loadHandler API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark Consumer
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Returns the list of registered type identifiers, in the order they were registered.
 | 
			
		||||
@property (copy, readonly, atomic) NSArray<NSString *> *registeredTypeIdentifiers;
 | 
			
		||||
 | 
			
		||||
- (NSArray<NSString *> *)registeredTypeIdentifiersWithFileOptions:(NSItemProviderFileOptions)fileOptions API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the item provider has at least one item that conforms to the supplied type identifier.
 | 
			
		||||
- (BOOL)hasItemConformingToTypeIdentifier:(NSString *)typeIdentifier;
 | 
			
		||||
 | 
			
		||||
- (BOOL)hasRepresentationConformingToTypeIdentifier:(NSString *)typeIdentifier
 | 
			
		||||
                                        fileOptions:(NSItemProviderFileOptions)fileOptions API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
// Copies the provided data into an NSData object.
 | 
			
		||||
- (NSProgress *)loadDataRepresentationForTypeIdentifier:(NSString *)typeIdentifier
 | 
			
		||||
                                      completionHandler:(void(^)(NSData * _Nullable data, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
// Writes a copy of the data to a temporary file. This file will be deleted when the completion handler returns. Your program should copy or move the file within the completion handler.
 | 
			
		||||
- (NSProgress *)loadFileRepresentationForTypeIdentifier:(NSString *)typeIdentifier
 | 
			
		||||
                                      completionHandler:(void(^)(NSURL * _Nullable url, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
// Open the original file in place, if possible.
 | 
			
		||||
// If a file is not available for opening in place, a copy of the file is written to a temporary location, and `isInPlace` is set to NO. Your program may then copy or move the file, or the system will delete this file at some point in the future.
 | 
			
		||||
- (NSProgress *)loadInPlaceFileRepresentationForTypeIdentifier:(NSString *)typeIdentifier
 | 
			
		||||
                                             completionHandler:(void (^)(NSURL * _Nullable url, BOOL isInPlace, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark Metadata
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@property (atomic, copy, nullable) NSString *suggestedName API_AVAILABLE(macos(10.14), ios(11.0)) API_UNAVAILABLE(watchos, tvos);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark - NSItemProviderReading and Writing interface
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Instantiate an NSItemProvider by querying an object for its eligible type identifiers via the NSItemProviderWriting protocol.
 | 
			
		||||
- (instancetype)initWithObject:(id<NSItemProviderWriting>)object API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
// Add representations from an object using the NSItemProviderWriting protocol. Duplicate representations are ignored.
 | 
			
		||||
- (void)registerObject:(id<NSItemProviderWriting>)object visibility:(NSItemProviderRepresentationVisibility)visibility API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
// Add representations from a class, but defer loading the object until needed.
 | 
			
		||||
- (void)registerObjectOfClass:(Class<NSItemProviderWriting>)aClass
 | 
			
		||||
                   visibility:(NSItemProviderRepresentationVisibility)visibility
 | 
			
		||||
                  loadHandler:(NSProgress * _Nullable (^)(void (^completionHandler)(__kindof id<NSItemProviderWriting> _Nullable object, NSError * _Nullable error)))loadHandler API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
- (BOOL)canLoadObjectOfClass:(Class<NSItemProviderReading>)aClass API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
// Instantiate an object using the NSItemProviderReading protocol.
 | 
			
		||||
- (NSProgress *)loadObjectOfClass:(Class<NSItemProviderReading>)aClass
 | 
			
		||||
                completionHandler:(void (^)(__kindof id<NSItemProviderReading> _Nullable object, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark - Coercing interface
 | 
			
		||||
 | 
			
		||||
// These methods allow you to assign NSSecureCoding-compliant objects to certain UTIs, and retrieve either the original object, or a coerced variant
 | 
			
		||||
// based on the following rules.
 | 
			
		||||
//
 | 
			
		||||
// If the object is retrieved using loadItemForTypeIdentifier:options:completionHandler, and the completion block signature contains a paramater of
 | 
			
		||||
// the same class as the initial object (or a superclass), the original object is returned.
 | 
			
		||||
//
 | 
			
		||||
// If the completion block signature contains a parameter that is not the same class as `item`, some coercion may occur:
 | 
			
		||||
//    Original class       Requested class          Coercion action
 | 
			
		||||
//    -------------------  -----------------------  -------------------
 | 
			
		||||
//    NSURL                NSData                   The contents of the URL is read and returned as NSData
 | 
			
		||||
//    NSData               NSImage/UIImage          An NSImage (macOS) or UIImage (iOS) is constructed from the data
 | 
			
		||||
//    NSURL                UIImage                  A UIImage is constructed from the file at the URL (iOS)
 | 
			
		||||
//    NSImage              NSData                   A TIFF representation of the image is returned
 | 
			
		||||
//
 | 
			
		||||
// When providing or consuming data using this interface, a file may be opened in-place depending on the NSExtension context in which this object is used.
 | 
			
		||||
//
 | 
			
		||||
// If the item is retrieved using the binary interface described above, the original object will be retrieved and coerced to NSData.
 | 
			
		||||
//
 | 
			
		||||
// Items registered using the binary interface will appear as NSData with respect to the coercing interface.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark Provider
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Initialize an NSItemProvider with an object assigned to a single UTI. `item` is retained.
 | 
			
		||||
- (instancetype)initWithItem:(nullable id<NSSecureCoding>)item typeIdentifier:(nullable NSString *)typeIdentifier NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
// Initialize an NSItemProvider with load handlers for the given file URL, and the file content. A type identifier is inferred from the file extension.
 | 
			
		||||
- (nullable instancetype)initWithContentsOfURL:(null_unspecified NSURL *)fileURL;
 | 
			
		||||
 | 
			
		||||
// Registers a load handler that returns an object, assigned to a single UTI.
 | 
			
		||||
- (void)registerItemForTypeIdentifier:(NSString *)typeIdentifier loadHandler:(NSItemProviderLoadHandler)loadHandler;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark Consumer
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Loads the best matching item for a type identifier. The returned object depends on the class specified for the completion handler's `item` parameter.
 | 
			
		||||
// See the table above for coercion rules.
 | 
			
		||||
- (void)loadItemForTypeIdentifier:(NSString *)typeIdentifier options:(nullable NSDictionary *)options completionHandler:(nullable NSItemProviderCompletionHandler)completionHandler;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Common keys for the item provider options dictionary.
 | 
			
		||||
FOUNDATION_EXTERN NSString * const NSItemProviderPreferredImageSizeKey API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); // NSValue of CGSize or NSSize, specifies image size in pixels.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Some uses of NSItemProvider support the use of optional preview images.
 | 
			
		||||
@interface NSItemProvider(NSPreviewSupport)
 | 
			
		||||
 | 
			
		||||
// Sets a custom preview image handler block for this item provider. The returned item should preferably be NSData or a file NSURL.
 | 
			
		||||
@property (nullable, copy, atomic) NSItemProviderLoadHandler previewImageHandler API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Loads the preview image for this item by either calling the supplied preview block or falling back to a QuickLook-based handler. This method, like loadItemForTypeIdentifier:options:completionHandler:, supports implicit type coercion for the item parameter of the completion block. Allowed value classes are: NSData, NSURL, UIImage/NSImage.
 | 
			
		||||
- (void)loadPreviewImageWithOptions:(null_unspecified NSDictionary *)options completionHandler:(null_unspecified NSItemProviderCompletionHandler)completionHandler API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Keys used in property list items received from or sent to JavaScript code
 | 
			
		||||
 | 
			
		||||
// If JavaScript code passes an object to its completionFunction, it will be placed into an item of type kUTTypePropertyList, containing an NSDictionary, under this key.
 | 
			
		||||
FOUNDATION_EXTERN NSString * _Null_unspecified const NSExtensionJavaScriptPreprocessingResultsKey API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Arguments to be passed to a JavaScript finalize method should be placed in an item of type kUTTypePropertyList, containing an NSDictionary, under this key.
 | 
			
		||||
FOUNDATION_EXTERN NSString * _Null_unspecified const NSExtensionJavaScriptFinalizeArgumentKey API_AVAILABLE(ios(8.0), watchos(2.0), tvos(9.0)) API_UNAVAILABLE(macos);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark - Errors
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Constant used by NSError to distinguish errors belonging to the NSItemProvider domain
 | 
			
		||||
FOUNDATION_EXTERN NSString * const NSItemProviderErrorDomain API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// NSItemProvider-related error codes
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSItemProviderErrorCode) {
 | 
			
		||||
    NSItemProviderUnknownError                                      = -1,
 | 
			
		||||
    NSItemProviderItemUnavailableError                              = -1000,
 | 
			
		||||
    NSItemProviderUnexpectedValueClassError                         = -1100,
 | 
			
		||||
    NSItemProviderUnavailableCoercionError API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = -1200
 | 
			
		||||
} API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#else // __OBJC2__
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@protocol NSItemProviderReading <NSObject>
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSItemProviderWriting <NSObject>
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -0,0 +1,8 @@
 | 
			
		||||
//
 | 
			
		||||
//  NSItemProviderReadingWriting.h
 | 
			
		||||
//  Foundation
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (c) 2017-2019, Apple Inc. All rights reserved.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSItemProvider.h>
 | 
			
		||||
@@ -0,0 +1,75 @@
 | 
			
		||||
/*	
 | 
			
		||||
    NSJSONSerialization.h
 | 
			
		||||
    Copyright (c) 2009-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSError, NSOutputStream, NSInputStream, NSData;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSJSONReadingOptions) {
 | 
			
		||||
    NSJSONReadingMutableContainers = (1UL << 0),
 | 
			
		||||
    NSJSONReadingMutableLeaves = (1UL << 1),
 | 
			
		||||
    NSJSONReadingFragmentsAllowed = (1UL << 2),
 | 
			
		||||
 | 
			
		||||
    NSJSONReadingJSON5Allowed API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) = (1UL << 3),
 | 
			
		||||
    NSJSONReadingTopLevelDictionaryAssumed API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)) = (1UL << 4),
 | 
			
		||||
 | 
			
		||||
    NSJSONReadingAllowFragments API_DEPRECATED_WITH_REPLACEMENT("NSJSONReadingFragmentsAllowed", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED)) = NSJSONReadingFragmentsAllowed,
 | 
			
		||||
} API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSJSONWritingOptions) {
 | 
			
		||||
    NSJSONWritingPrettyPrinted = (1UL << 0),
 | 
			
		||||
 | 
			
		||||
    /* Sorts dictionary keys for output using [NSLocale systemLocale]. Keys are compared using NSNumericSearch. The specific sorting method used is subject to change.
 | 
			
		||||
     */
 | 
			
		||||
    NSJSONWritingSortedKeys API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0)) = (1UL << 1),
 | 
			
		||||
    NSJSONWritingFragmentsAllowed = (1UL << 2),
 | 
			
		||||
    NSJSONWritingWithoutEscapingSlashes API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0)) = (1UL << 3),
 | 
			
		||||
} API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* A class for converting JSON to Foundation objects and converting Foundation objects to JSON.
 | 
			
		||||
   
 | 
			
		||||
   An object that may be converted to JSON must have the following properties:
 | 
			
		||||
    - Top level object is an NSArray or NSDictionary
 | 
			
		||||
    - All objects are NSString, NSNumber, NSArray, NSDictionary, or NSNull
 | 
			
		||||
    - All dictionary keys are NSStrings
 | 
			
		||||
    - NSNumbers are not NaN or infinity
 | 
			
		||||
*/
 | 
			
		||||
API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSJSONSerialization : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    void *reserved[6];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Returns YES if the given object can be converted to JSON data, NO otherwise. The object must have the following properties:
 | 
			
		||||
    - Top level object is an NSArray or NSDictionary
 | 
			
		||||
    - All objects are NSString, NSNumber, NSArray, NSDictionary, or NSNull
 | 
			
		||||
    - All dictionary keys are NSStrings
 | 
			
		||||
    - NSNumbers are not NaN or infinity
 | 
			
		||||
 Other rules may apply. Calling this method or attempting a conversion are the definitive ways to tell if a given object can be converted to JSON data.
 | 
			
		||||
 */
 | 
			
		||||
+ (BOOL)isValidJSONObject:(id)obj;
 | 
			
		||||
 | 
			
		||||
/* Generate JSON data from a Foundation object. If the object will not produce valid JSON then an exception will be thrown. Setting the NSJSONWritingPrettyPrinted option will generate JSON with whitespace designed to make the output more readable. If that option is not set, the most compact possible JSON will be generated. If an error occurs, the error parameter will be set and the return value will be nil. The resulting data is a encoded in UTF-8.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable NSData *)dataWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError **)error;
 | 
			
		||||
 | 
			
		||||
/* Create a Foundation object from JSON data. Set the NSJSONReadingAllowFragments option if the parser should allow top-level objects that are not an NSArray or NSDictionary. Setting the NSJSONReadingMutableContainers option will make the parser generate mutable NSArrays and NSDictionaries. Setting the NSJSONReadingMutableLeaves option will make the parser generate mutable NSString objects. If an error occurs during the parse, then the error parameter will be set and the result will be nil.
 | 
			
		||||
   The data must be in one of the 5 supported encodings listed in the JSON specification: UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE. The data may or may not have a BOM. The most efficient encoding to use for parsing is UTF-8, so if you have a choice in encoding the data passed to this method, use UTF-8.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable id)JSONObjectWithData:(NSData *)data options:(NSJSONReadingOptions)opt error:(NSError **)error;
 | 
			
		||||
 | 
			
		||||
/* Write JSON data into a stream. The stream should be opened and configured. The return value is the number of bytes written to the stream, or 0 on error. All other behavior of this method is the same as the dataWithJSONObject:options:error: method.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSInteger)writeJSONObject:(id)obj toStream:(NSOutputStream *)stream options:(NSJSONWritingOptions)opt error:(NSError **)error;
 | 
			
		||||
 | 
			
		||||
/* Create a JSON object from JSON data stream. The stream should be opened and configured. All other behavior of this method is the same as the JSONObjectWithData:options:error: method.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable id)JSONObjectWithStream:(NSInputStream *)stream options:(NSJSONReadingOptions)opt error:(NSError **)error;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,227 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSKeyValueCoding.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSOrderedSet.h>
 | 
			
		||||
#import <Foundation/NSSet.h>
 | 
			
		||||
#import <Foundation/NSException.h>
 | 
			
		||||
 | 
			
		||||
@class NSError, NSString;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* The exception that is thrown when a key value coding operation fails. The exception's user info dictionary will contain at least two entries:
 | 
			
		||||
    - @"NSTargetObjectUserInfoKey": the receiver of the failed KVC message.
 | 
			
		||||
    - @"NSUnknownUserInfoKey": the key that was used in the failed KVC message.
 | 
			
		||||
 | 
			
		||||
The actual value of this constant string is "NSUnknownKeyException," to match the exceptions that are thrown by KVC methods that were deprecated in Mac OS 10.3.
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSUndefinedKeyException;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSKeyValueOperator NS_TYPED_ENUM;
 | 
			
		||||
 | 
			
		||||
/* Strings for the names of array operators supported by key-value coding. Only these string declarations are new in Mac OS 10.4. The actual support for array operators appeared in Mac OS 10.3. The values of these do not include "@" prefixes.
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSAverageKeyValueOperator;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSCountKeyValueOperator;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSDistinctUnionOfArraysKeyValueOperator;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSDistinctUnionOfObjectsKeyValueOperator;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSDistinctUnionOfSetsKeyValueOperator;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSMaximumKeyValueOperator;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSMinimumKeyValueOperator;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSSumKeyValueOperator;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSUnionOfArraysKeyValueOperator;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSUnionOfObjectsKeyValueOperator;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueOperator const NSUnionOfSetsKeyValueOperator;
 | 
			
		||||
 | 
			
		||||
@interface NSObject(NSKeyValueCoding)
 | 
			
		||||
 | 
			
		||||
/* Return YES if -valueForKey:, -setValue:forKey:, -mutableArrayValueForKey:, -storedValueForKey:, -takeStoredValue:forKey:, and -takeValue:forKey: may directly manipulate instance variables when sent to instances of the receiving class, NO otherwise. The default implementation of this property returns YES.
 | 
			
		||||
*/
 | 
			
		||||
@property (class, readonly) BOOL accessInstanceVariablesDirectly;
 | 
			
		||||
 | 
			
		||||
/* Given a key that identifies an attribute or to-one relationship, return the attribute value or the related object. Given a key that identifies a to-many relationship, return an immutable array or an immutable set that contains all of the related objects.
 | 
			
		||||
    
 | 
			
		||||
The default implementation of this method does the following:
 | 
			
		||||
    1. Searches the class of the receiver for an accessor method whose name matches the pattern -get<Key>, -<key>, or -is<Key>, in that order. If such a method is found it is invoked. If the type of the method's result is an object pointer type the result is simply returned. If the type of the result is one of the scalar types supported by NSNumber conversion is done and an NSNumber is returned. Otherwise, conversion is done and an NSValue is returned (new in Mac OS 10.5: results of arbitrary type are converted to NSValues, not just NSPoint, NRange, NSRect, and NSSize).
 | 
			
		||||
    2 (introduced in Mac OS 10.7). Otherwise (no simple accessor method is found), searches the class of the receiver for methods whose names match the patterns -countOf<Key> and -indexIn<Key>OfObject: and -objectIn<Key>AtIndex: (corresponding to the primitive methods defined by the NSOrderedSet class) and also -<key>AtIndexes: (corresponding to -[NSOrderedSet objectsAtIndexes:]). If a count method and an indexOf method and at least one of the other two possible methods are found, a collection proxy object that responds to all NSOrderedSet methods is returned. Each NSOrderedSet message sent to the collection proxy object will result in some combination of -countOf<Key>, -indexIn<Key>OfObject:, -objectIn<Key>AtIndex:, and -<key>AtIndexes: messages being sent to the original receiver of -valueForKey:. If the class of the receiver also implements an optional method whose name matches the pattern -get<Key>:range: that method will be used when appropriate for best performance.
 | 
			
		||||
    3. Otherwise (no simple accessor method or set of ordered set access methods is found), searches the class of the receiver for methods whose names match the patterns -countOf<Key> and -objectIn<Key>AtIndex: (corresponding to the primitive methods defined by the NSArray class) and (introduced in Mac OS 10.4) also -<key>AtIndexes: (corresponding to -[NSArray objectsAtIndexes:]). If a count method and at least one of the other two possible methods are found, a collection proxy object that responds to all NSArray methods is returned. Each NSArray message sent to the collection proxy object will result in some combination of -countOf<Key>, -objectIn<Key>AtIndex:, and -<key>AtIndexes: messages being sent to the original receiver of -valueForKey:. If the class of the receiver also implements an optional method whose name matches the pattern -get<Key>:range: that method will be used when appropriate for best performance.
 | 
			
		||||
    4 (introduced in Mac OS 10.4). Otherwise (no simple accessor method or set of ordered set or array access methods is found), searches the class of the receiver for a threesome of methods whose names match the patterns -countOf<Key>, -enumeratorOf<Key>, and -memberOf<Key>: (corresponding to the primitive methods defined by the NSSet class). If all three such methods are found a collection proxy object that responds to all NSSet methods is returned. Each NSSet message sent to the collection proxy object will result in some combination of -countOf<Key>, -enumeratorOf<Key>, and -memberOf<Key>: messages being sent to the original receiver of -valueForKey:.
 | 
			
		||||
    5. Otherwise (no simple accessor method or set of collection access methods is found), if the receiver's class' +accessInstanceVariablesDirectly property returns YES, searches the class of the receiver for an instance variable whose name matches the pattern _<key>, _is<Key>, <key>, or is<Key>, in that order. If such an instance variable is found, the value of the instance variable in the receiver is returned, with the same sort of conversion to NSNumber or NSValue as in step 1.
 | 
			
		||||
    6. Otherwise (no simple accessor method, set of collection access methods, or instance variable is found), invokes -valueForUndefinedKey: and returns the result. The default implementation of -valueForUndefinedKey: raises an NSUndefinedKeyException, but you can override it in your application.
 | 
			
		||||
 | 
			
		||||
Compatibility notes:
 | 
			
		||||
    - For backward binary compatibility, an accessor method whose name matches the pattern -_get<Key>, or -_<key> is searched for between steps 1 and 3. If such a method is found it is invoked, with the same sort of conversion to NSNumber or NSValue as in step 1. KVC accessor methods whose names start with underscores were deprecated as of Mac OS 10.3 though.
 | 
			
		||||
    - The behavior described in step 5 is a change from Mac OS 10.2, in which the instance variable search order was <key>, _<key>.
 | 
			
		||||
    - For backward binary compatibility, -handleQueryWithUnboundKey: will be invoked instead of -valueForUndefinedKey: in step 6, if the implementation of -handleQueryWithUnboundKey: in the receiver's class is not NSObject's.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)valueForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Given a value and a key that identifies an attribute, set the value of the attribute. Given an object and a key that identifies a to-one relationship, relate the object to the receiver, unrelating the previously related object if there was one. Given a collection object and a key that identifies a to-many relationship, relate the objects contained in the collection to the receiver, unrelating previously related objects if there were any.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method does the following:
 | 
			
		||||
    1. Searches the class of the receiver for an accessor method whose name matches the pattern -set<Key>:. If such a method is found the type of its parameter is checked. If the parameter type is not an object pointer type but the value is nil -setNilValueForKey: is invoked. The default implementation of -setNilValueForKey: raises an NSInvalidArgumentException, but you can override it in your application. Otherwise, if the type of the method's parameter is an object pointer type the method is simply invoked with the value as the argument. If the type of the method's parameter is some other type the inverse of the NSNumber/NSValue conversion done by -valueForKey: is performed before the method is invoked.
 | 
			
		||||
    2. Otherwise (no accessor method is found), if the receiver's class' +accessInstanceVariablesDirectly property returns YES, searches the class of the receiver for an instance variable whose name matches the pattern _<key>, _is<Key>, <key>, or is<Key>, in that order. If such an instance variable is found and its type is an object pointer type the value is retained and the result is set in the instance variable, after the instance variable's old value is first released. If the instance variable's type is some other type its value is set after the same sort of conversion from NSNumber or NSValue as in step 1.
 | 
			
		||||
    3. Otherwise (no accessor method or instance variable is found), invokes -setValue:forUndefinedKey:. The default implementation of -setValue:forUndefinedKey: raises an NSUndefinedKeyException, but you can override it in your application.
 | 
			
		||||
 | 
			
		||||
Compatibility notes:
 | 
			
		||||
    - For backward binary compatibility with -takeValue:forKey:'s behavior, a method whose name matches the pattern -_set<Key>: is also recognized in step 1. KVC accessor methods whose names start with underscores were deprecated as of Mac OS 10.3 though.
 | 
			
		||||
    - For backward binary compatibility, -unableToSetNilForKey: will be invoked instead of -setNilValueForKey: in step 1, if the implementation of -unableToSetNilForKey: in the receiver's class is not NSObject's.
 | 
			
		||||
    - The behavior described in step 2 is different from -takeValue:forKey:'s, in which the instance variable search order is <key>, _<key>.
 | 
			
		||||
    - For backward binary compatibility with -takeValue:forKey:'s behavior, -handleTakeValue:forUnboundKey: will be invoked instead of -setValue:forUndefinedKey: in step 3, if the implementation of -handleTakeValue:forUnboundKey: in the receiver's class is not NSObject's.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setValue:(nullable id)value forKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Given a pointer to a value pointer, a key that identifies an attribute or to-one relationship, and a pointer to an NSError pointer, return a value that is suitable for use in subsequent -setValue:forKey: messages sent to the same receiver. If no validation is necessary, return YES without altering *ioValue or *outError. If validation is necessary and possible, return YES after setting *ioValue to an object that is the validated version of the original value, but without altering *outError. If validation is necessary but not possible, return NO after setting *outError to an NSError that encapsulates the reason that validation was not possible, but without altering *ioValue. The sender of the message is never given responsibility for releasing ioValue or outError.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method searches the class of the receiver for a validator method whose name matches the pattern -validate<Key>:error:. If such a method is found it is invoked and the result is returned. If no such method is found, YES is returned.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)validateValue:(inout id _Nullable * _Nonnull)ioValue forKey:(NSString *)inKey error:(out NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Given a key that identifies an _ordered_ to-many relationship, return a mutable array that provides read-write access to the related objects. Objects added to the mutable array will become related to the receiver, and objects removed from the mutable array will become unrelated.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method recognizes the same simple accessor methods and array accessor methods as -valueForKey:'s, and follows the same direct instance variable access policies, but always returns a mutable collection proxy object instead of the immutable collection that -valueForKey: would return. It also:
 | 
			
		||||
    1. Searches the class of the receiver for methods whose names match the patterns -insertObject:in<Key>AtIndex: and -removeObjectFrom<Key>AtIndex: (corresponding to the two most primitive methods defined by the NSMutableArray class), and (introduced in Mac OS 10.4) also -insert<Key>:atIndexes: and -remove<Key>AtIndexes: (corresponding to -[NSMutableArray insertObjects:atIndexes:] and -[NSMutableArray removeObjectsAtIndexes:). If at least one insertion method and at least one removal method are found each NSMutableArray message sent to the collection proxy object will result in some combination of -insertObject:in<Key>AtIndex:, -removeObjectFrom<Key>AtIndex:, -insert<Key>:atIndexes:, and -remove<Key>AtIndexes: messages being sent to the original receiver of -mutableArrayValueForKey:. If the class of the receiver also implements an optional method whose name matches the pattern -replaceObjectIn<Key>AtIndex:withObject: or (introduced in Mac OS 10.4) -replace<Key>AtIndexes:with<Key>: that method will be used when appropriate for best performance.
 | 
			
		||||
    2. Otherwise (no set of array mutation methods is found), searches the class of the receiver for an accessor method whose name matches the pattern -set<Key>:. If such a method is found each NSMutableArray message sent to the collection proxy object will result in a -set<Key>: message being sent to the original receiver of -mutableArrayValueForKey:.
 | 
			
		||||
    3. Otherwise (no set of array mutation methods or simple accessor method is found), if the receiver's class' +accessInstanceVariablesDirectly property returns YES, searches the class of the receiver for an instance variable whose name matches the pattern _<key> or <key>, in that order. If such an instance variable is found, each NSMutableArray message sent to the collection proxy object will be forwarded to the instance variable's value, which therefore must typically be an instance of NSMutableArray or a subclass of NSMutableArray.
 | 
			
		||||
    4. Otherwise (no set of array mutation methods, simple accessor method, or instance variable is found), returns a mutable collection proxy object anyway. Each NSMutableArray message sent to the collection proxy object will result in a -setValue:forUndefinedKey: message being sent to the original receiver of -mutableArrayValueForKey:. The default implementation of -setValue:forUndefinedKey: raises an NSUndefinedKeyException, but you can override it in your application.
 | 
			
		||||
 | 
			
		||||
Performance note: the repetitive -set<Key>: messages implied by step 2's description are a potential performance problem. For better performance implement insertion and removal methods that fulfill the requirements for step 1 in your KVC-compliant class. For best performance implement a replacement method too.
 | 
			
		||||
*/
 | 
			
		||||
- (NSMutableArray *)mutableArrayValueForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Given a key that identifies an _ordered_ and uniquing to-many relationship, return a mutable ordered set that provides read-write access to the related objects. Objects added to the mutable ordered set will become related to the receiver, and objects removed from the mutable ordered set will become unrelated.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method recognizes the same simple accessor methods and ordered set accessor methods as -valueForKey:'s, and follows the same direct instance variable access policies, but always returns a mutable collection proxy object instead of the immutable collection that -valueForKey: would return. It also:
 | 
			
		||||
    1. Searches the class of the receiver for methods whose names match the patterns -insertObject:in<Key>AtIndex: and -removeObjectFrom<Key>AtIndex: (corresponding to the two most primitive methods defined by the NSMutableOrderedSet class), and also -insert<Key>:atIndexes: and -remove<Key>AtIndexes: (corresponding to -[NSMutableOrderedSet insertObjects:atIndexes:] and -[NSMutableOrderedSet removeObjectsAtIndexes:). If at least one insertion method and at least one removal method are found each NSMutableOrderedSet message sent to the collection proxy object will result in some combination of -insertObject:in<Key>AtIndex:, -removeObjectFrom<Key>AtIndex:, -insert<Key>:atIndexes:, and -remove<Key>AtIndexes: messages being sent to the original receiver of -mutableOrderedSetValueForKey:. If the class of the receiver also implements an optional method whose name matches the pattern -replaceObjectIn<Key>AtIndex:withObject: or -replace<Key>AtIndexes:with<Key>: that method will be used when appropriate for best performance.
 | 
			
		||||
    2. Otherwise (no set of ordered set mutation methods is found), searches the class of the receiver for an accessor method whose name matches the pattern -set<Key>:. If such a method is found each NSMutableOrderedSet message sent to the collection proxy object will result in a -set<Key>: message being sent to the original receiver of -mutableOrderedSetValueForKey:.
 | 
			
		||||
    3. Otherwise (no set of ordered set mutation methods or simple accessor method is found), if the receiver's class' +accessInstanceVariablesDirectly property returns YES, searches the class of the receiver for an instance variable whose name matches the pattern _<key> or <key>, in that order. If such an instance variable is found, each NSMutableOrderedSet message sent to the collection proxy object will be forwarded to the instance variable's value, which therefore must typically be an instance of NSMutableOrderedSet or a subclass of NSMutableOrderedSet.
 | 
			
		||||
    4. Otherwise (no set of ordered set mutation methods, simple accessor method, or instance variable is found), returns a mutable collection proxy object anyway. Each NSMutableOrderedSet message sent to the collection proxy object will result in a -setValue:forUndefinedKey: message being sent to the original receiver of -mutableOrderedSetValueForKey:. The default implementation of -setValue:forUndefinedKey: raises an NSUndefinedKeyException, but you can override it in your application.
 | 
			
		||||
 | 
			
		||||
Performance note: the repetitive -set<Key>: messages implied by step 2's description are a potential performance problem. For better performance implement insertion and removal methods that fulfill the requirements for step 1 in your KVC-compliant class. For best performance implement a replacement method too.
 | 
			
		||||
*/
 | 
			
		||||
- (NSMutableOrderedSet *)mutableOrderedSetValueForKey:(NSString *)key API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Given a key that identifies an _unordered_ and uniquing to-many relationship, return a mutable set that provides read-write access to the related objects. Objects added to the mutable set will become related to the receiver, and objects removed from the mutable set will become unrelated.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method recognizes the same simple accessor methods and set accessor methods as -valueForKey:'s, and follows the same direct instance variable access policies, but always returns a mutable collection proxy object instead of the immutable collection that -valueForKey: would return. It also:
 | 
			
		||||
    1. Searches the class of the receiver for methods whose names match the patterns -add<Key>Object: and -remove<Key>Object: (corresponding to the two primitive methods defined by the NSMutableSet class) and also -add<Key>: and -remove<Key>: (corresponding to -[NSMutableSet unionSet:] and -[NSMutableSet minusSet:]). If at least one addition method and at least one removal method are found each NSMutableSet message sent to the collection proxy object will result in some combination of -add<Key>Object:, -remove<Key>Object:, -add<Key>:, and -remove<Key>: messages being sent to the original receiver of -mutableSetValueForKey:. If the class of the receiver also implements an optional method whose name matches the pattern -intersect<Key>: or -set<Key>: that method will be used when appropriate for best performance.
 | 
			
		||||
    2. Otherwise (no set of set mutation methods is found), searches the class of the receiver for an accessor method whose name matches the pattern -set<Key>:. If such a method is found each NSMutableSet message sent to the collection proxy object will result in a -set<Key>: message being sent to the original receiver of -mutableSetValueForKey:.
 | 
			
		||||
    3. Otherwise (no set of set mutation methods or simple accessor method is found), if the receiver's class' +accessInstanceVariablesDirectly property returns YES, searches the class of the receiver for an instance variable whose name matches the pattern _<key> or <key>, in that order. If such an instance variable is found, each NSMutableSet message sent to the collection proxy object will be forwarded to the instance variable's value, which therefore must typically be an instance of NSMutableSet or a subclass of NSMutableSet.
 | 
			
		||||
    4. Otherwise (no set of set mutation methods, simple accessor method, or instance variable is found), returns a mutable collection proxy object anyway. Each NSMutableSet message sent to the collection proxy object will result in a -setValue:forUndefinedKey: message being sent to the original receiver of -mutableSetValueForKey:. The default implementation of -setValue:forUndefinedKey: raises an NSUndefinedKeyException, but you can override it in your application.
 | 
			
		||||
 | 
			
		||||
Performance note: the repetitive -set<Key>: messages implied by step 2's description are a potential performance problem. For better performance implement methods that fulfill the requirements for step 1 in your KVC-compliant class.
 | 
			
		||||
*/
 | 
			
		||||
- (NSMutableSet *)mutableSetValueForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Key-path-taking variants of like-named methods. The default implementation of each parses the key path enough to determine whether or not it has more than one component (key path components are separated by periods). If so, -valueForKey: is invoked with the first key path component as the argument, and the method being invoked is invoked recursively on the result, with the remainder of the key path passed as an argument. If not, the like-named non-key-path-taking method is invoked.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)valueForKeyPath:(NSString *)keyPath;
 | 
			
		||||
- (void)setValue:(nullable id)value forKeyPath:(NSString *)keyPath;
 | 
			
		||||
- (BOOL)validateValue:(inout id _Nullable * _Nonnull)ioValue forKeyPath:(NSString *)inKeyPath error:(out NSError **)outError;
 | 
			
		||||
- (NSMutableArray *)mutableArrayValueForKeyPath:(NSString *)keyPath;
 | 
			
		||||
- (NSMutableOrderedSet *)mutableOrderedSetValueForKeyPath:(NSString *)keyPath API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (NSMutableSet *)mutableSetValueForKeyPath:(NSString *)keyPath;
 | 
			
		||||
 | 
			
		||||
/* Given that an invocation of -valueForKey: would be unable to get a keyed value using its default access mechanism, return the keyed value using some other mechanism. The default implementation of this method raises an NSUndefinedKeyException. You can override it to handle properties that are dynamically defined at run-time.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)valueForUndefinedKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Given that an invocation of -setValue:forKey: would be unable to set the keyed value using its default mechanism, set the keyed value using some other mechanism. The default implementation of this method raises an NSUndefinedKeyException. You can override it to handle properties that are dynamically defined at run-time.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setValue:(nullable id)value forUndefinedKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Given that an invocation of -setValue:forKey: would be unable to set the keyed value because the type of the parameter of the corresponding accessor method is an NSNumber scalar type or NSValue structure type but the value is nil, set the keyed value using some other mechanism. The default implementation of this method raises an NSInvalidArgumentException. You can override it to map nil values to something meaningful in the context of your application.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setNilValueForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Given an array of keys, return a dictionary containing the keyed attribute values, to-one-related objects, and/or collections of to-many-related objects. Entries for which -valueForKey: returns nil have NSNull as their value in the returned dictionary.
 | 
			
		||||
*/
 | 
			
		||||
- (NSDictionary<NSString *, id> *)dictionaryWithValuesForKeys:(NSArray<NSString *> *)keys;
 | 
			
		||||
 | 
			
		||||
/* Given a dictionary containing keyed attribute values, to-one-related objects, and/or collections of to-many-related objects, set the keyed values. Dictionary entries whose values are NSNull result in -setValue:nil forKey:key messages being sent to the receiver.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *, id> *)keyedValues;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSArray<ObjectType>(NSKeyValueCoding)
 | 
			
		||||
 | 
			
		||||
/* Return an array containing the results of invoking -valueForKey: on each of the receiver's elements. The returned array will contain NSNull elements for each instance of -valueForKey: returning nil.
 | 
			
		||||
*/
 | 
			
		||||
- (id)valueForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Invoke -setValue:forKey: on each of the receiver's elements.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setValue:(nullable id)value forKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDictionary<KeyType, ObjectType>(NSKeyValueCoding)
 | 
			
		||||
 | 
			
		||||
/* Return the result of sending -objectForKey: to the receiver.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable ObjectType)valueForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableDictionary<KeyType, ObjectType>(NSKeyValueCoding)
 | 
			
		||||
 | 
			
		||||
/* Send -setObject:forKey: to the receiver, unless the value is nil, in which case send -removeObjectForKey:.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setValue:(nullable ObjectType)value forKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSOrderedSet<ObjectType>(NSKeyValueCoding)
 | 
			
		||||
 | 
			
		||||
/* Return an ordered set containing the results of invoking -valueForKey: on each of the receiver's members. The returned ordered set might not have the same number of members as the receiver. The returned ordered set will not contain any elements corresponding to instances of -valueForKey: returning nil, nor will it contain duplicates.
 | 
			
		||||
*/
 | 
			
		||||
- (id)valueForKey:(NSString *)key API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Invoke -setValue:forKey: on each of the receiver's members.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setValue:(nullable id)value forKey:(NSString *)key API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSSet<ObjectType>(NSKeyValueCoding)
 | 
			
		||||
 | 
			
		||||
/* Return a set containing the results of invoking -valueForKey: on each of the receiver's members. The returned set might not have the same number of members as the receiver. The returned set will not contain any elements corresponding to instances of -valueForKey: returning nil (in contrast with -[NSArray(NSKeyValueCoding) valueForKey:], which may put NSNulls in the arrays it returns).
 | 
			
		||||
*/
 | 
			
		||||
- (id)valueForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Invoke -setValue:forKey: on each of the receiver's members.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setValue:(nullable id)value forKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
 | 
			
		||||
@interface NSObject(NSDeprecatedKeyValueCoding)
 | 
			
		||||
 | 
			
		||||
/* Methods that were deprecated in Mac OS 10.4.
 | 
			
		||||
*/
 | 
			
		||||
+ (BOOL)useStoredAccessor API_DEPRECATED("Legacy KVC API", macos(10.0,10.4), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (nullable id)storedValueForKey:(NSString *)key API_DEPRECATED("Legacy KVC API", macos(10.0,10.4), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (void)takeStoredValue:(nullable id)value forKey:(NSString *)key API_DEPRECATED("Legacy KVC API", macos(10.0,10.4), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
/* Methods that were deprecated in Mac OS 10.3. Use the new, more consistently named, methods declared above instead.
 | 
			
		||||
*/
 | 
			
		||||
- (void)takeValue:(nullable id)value forKey:(NSString *)key API_DEPRECATED("Legacy KVC API", macos(10.0,10.3), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (void)takeValue:(nullable id)value forKeyPath:(NSString *)keyPath API_DEPRECATED("Legacy KVC API", macos(10.0,10.3), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (nullable id)handleQueryWithUnboundKey:(NSString *)key API_DEPRECATED("Legacy KVC API", macos(10.0,10.3), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (void)handleTakeValue:(nullable id)value forUnboundKey:(NSString *)key API_DEPRECATED("Legacy KVC API", macos(10.0,10.3), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (void)unableToSetNilForKey:(NSString *)key API_DEPRECATED("Legacy KVC API", macos(10.0,10.3), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (NSDictionary *)valuesForKeys:(NSArray *)keys API_DEPRECATED("Legacy KVC API", macos(10.0,10.3), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
- (void)takeValuesFromDictionary:(NSDictionary *)properties API_DEPRECATED("Legacy KVC API", macos(10.0,10.3), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,202 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSKeyValueObserving.h
 | 
			
		||||
	Copyright (c) 2003-2019, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSOrderedSet.h>
 | 
			
		||||
#import <Foundation/NSSet.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
 | 
			
		||||
@class NSIndexSet, NSString;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* Options for use with -addObserver:forKeyPath:options:context: and -addObserver:toObjectsAtIndexes:forKeyPath:options:context:.
 | 
			
		||||
*/
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSKeyValueObservingOptions) {
 | 
			
		||||
 | 
			
		||||
    /* Whether the change dictionaries sent in notifications should contain NSKeyValueChangeNewKey and NSKeyValueChangeOldKey entries, respectively.
 | 
			
		||||
    */
 | 
			
		||||
    NSKeyValueObservingOptionNew = 0x01,
 | 
			
		||||
    NSKeyValueObservingOptionOld = 0x02,
 | 
			
		||||
 | 
			
		||||
    /* Whether a notification should be sent to the observer immediately, before the observer registration method even returns. The change dictionary in the notification will always contain an NSKeyValueChangeNewKey entry if NSKeyValueObservingOptionNew is also specified but will never contain an NSKeyValueChangeOldKey entry. (In an initial notification the current value of the observed property may be old, but it's new to the observer.) You can use this option instead of explicitly invoking, at the same time, code that is also invoked by the observer's -observeValueForKeyPath:ofObject:change:context: method. When this option is used with -addObserver:toObjectsAtIndexes:forKeyPath:options:context: a notification will be sent for each indexed object to which the observer is being added.
 | 
			
		||||
    */
 | 
			
		||||
    NSKeyValueObservingOptionInitial API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 0x04,
 | 
			
		||||
 | 
			
		||||
    /* Whether separate notifications should be sent to the observer before and after each change, instead of a single notification after the change. The change dictionary in a notification sent before a change always contains an NSKeyValueChangeNotificationIsPriorKey entry whose value is [NSNumber numberWithBool:YES], but never contains an NSKeyValueChangeNewKey entry. You can use this option when the observer's own KVO-compliance requires it to invoke one of the -willChange... methods for one of its own properties, and the value of that property depends on the value of the observed object's property. (In that situation it's too late to easily invoke -willChange... properly in response to receiving an -observeValueForKeyPath:ofObject:change:context: message after the change.)
 | 
			
		||||
 | 
			
		||||
When this option is specified, the change dictionary in a notification sent after a change contains the same entries that it would contain if this option were not specified, except for ordered unique to-many relationships represented by NSOrderedSets.  For those, for NSKeyValueChangeInsertion and NSKeyValueChangeReplacement changes, the change dictionary for a will-change notification contains an NSKeyValueChangeIndexesKey (and NSKeyValueChangeOldKey in the case of Replacement where the NSKeyValueObservingOptionOld option was specified at registration time) which give the indexes (and objects) which *may* be changed by the operation.  The second notification, after the change, contains entries reporting what did actually change.  For NSKeyValueChangeRemoval changes, removals by index are precise.
 | 
			
		||||
    */
 | 
			
		||||
    NSKeyValueObservingOptionPrior API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 0x08
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Possible values in the NSKeyValueChangeKindKey entry in change dictionaries. See the comments for -observeValueForKeyPath:ofObject:change:context: for more information.
 | 
			
		||||
*/
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSKeyValueChange) {
 | 
			
		||||
    NSKeyValueChangeSetting = 1,
 | 
			
		||||
    NSKeyValueChangeInsertion = 2,
 | 
			
		||||
    NSKeyValueChangeRemoval = 3,
 | 
			
		||||
    NSKeyValueChangeReplacement = 4,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Possible kinds of set mutation for use with -willChangeValueForKey:withSetMutation:usingObjects: and -didChangeValueForKey:withSetMutation:usingObjects:. Their semantics correspond exactly to NSMutableSet's -unionSet:, -minusSet:, -intersectSet:, and -setSet: method, respectively.
 | 
			
		||||
*/
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSKeyValueSetMutationKind) {
 | 
			
		||||
    NSKeyValueUnionSetMutation = 1,
 | 
			
		||||
    NSKeyValueMinusSetMutation = 2,
 | 
			
		||||
    NSKeyValueIntersectSetMutation = 3,
 | 
			
		||||
    NSKeyValueSetSetMutation = 4
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSKeyValueChangeKey NS_TYPED_ENUM;
 | 
			
		||||
/* Keys for entries in change dictionaries. See the comments for -observeValueForKeyPath:ofObject:change:context: for more information.
 | 
			
		||||
*/
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueChangeKey const NSKeyValueChangeKindKey;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueChangeKey const NSKeyValueChangeNewKey;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueChangeKey const NSKeyValueChangeOldKey;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueChangeKey const NSKeyValueChangeIndexesKey;
 | 
			
		||||
FOUNDATION_EXPORT NSKeyValueChangeKey const NSKeyValueChangeNotificationIsPriorKey API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@interface NSObject(NSKeyValueObserving)
 | 
			
		||||
 | 
			
		||||
/* Given that the receiver has been registered as an observer of the value at a key path relative to an object, be notified of a change to that value.
 | 
			
		||||
 | 
			
		||||
The change dictionary always contains an NSKeyValueChangeKindKey entry whose value is an NSNumber wrapping an NSKeyValueChange (use -[NSNumber unsignedIntegerValue]). The meaning of NSKeyValueChange depends on what sort of property is identified by the key path:
 | 
			
		||||
    - For any sort of property (attribute, to-one relationship, or ordered or unordered to-many relationship) NSKeyValueChangeSetting indicates that the observed object has received a -setValue:forKey: message, or that the key-value coding-compliant set method for the key has been invoked, or that a -willChangeValueForKey:/-didChangeValueForKey: pair has otherwise been invoked.
 | 
			
		||||
    - For an _ordered_ to-many relationship, NSKeyValueChangeInsertion, NSKeyValueChangeRemoval, and NSKeyValueChangeReplacement indicate that a mutating message has been sent to the array returned by a -mutableArrayValueForKey: message sent to the object, or sent to the ordered set returned by a -mutableOrderedSetValueForKey: message sent to the object, or that one of the key-value coding-compliant array or ordered set mutation methods for the key has been invoked, or that a -willChange:valuesAtIndexes:forKey:/-didChange:valuesAtIndexes:forKey: pair has otherwise been invoked.
 | 
			
		||||
    - For an _unordered_ to-many relationship (introduced in Mac OS 10.4), NSKeyValueChangeInsertion, NSKeyValueChangeRemoval, and NSKeyValueChangeReplacement indicate that a mutating message has been sent to the set returned by a -mutableSetValueForKey: message sent to the object, or that one of the key-value coding-compliant set mutation methods for the key has been invoked, or that a -willChangeValueForKey:withSetMutation:usingObjects:/-didChangeValueForKey:withSetMutation:usingObjects: pair has otherwise been invoked.
 | 
			
		||||
 | 
			
		||||
For any sort of property, the change dictionary contains an NSKeyValueChangeNewKey entry if NSKeyValueObservingOptionNew was specified at observer registration time, it's the right kind of change, and this isn't a prior notification. The change dictionary contains an NSKeyValueChangeOldKey if NSKeyValueObservingOptionOld was specified and it's the right kind of change. See the comments for the NSKeyValueObserverNotification informal protocol methods for what the values of those entries can be.
 | 
			
		||||
 | 
			
		||||
For an _ordered_ to-many relationship, the change dictionary always contains an NSKeyValueChangeIndexesKey entry whose value is an NSIndexSet containing the indexes of the inserted, removed, or replaced objects, unless the change is an NSKeyValueChangeSetting.
 | 
			
		||||
 | 
			
		||||
If NSKeyValueObservingOptionPrior (introduced in Mac OS 10.5) was specified at observer registration time, and this notification is one being sent prior to a change as a result, the change dictionary contains an NSKeyValueChangeNotificationIsPriorKey entry whose value is an NSNumber wrapping YES (use -[NSNumber boolValue]).
 | 
			
		||||
 | 
			
		||||
context is always the same pointer that was passed in at observer registration time.
 | 
			
		||||
*/
 | 
			
		||||
- (void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id)object change:(nullable NSDictionary<NSKeyValueChangeKey, id> *)change context:(nullable void *)context;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSObject(NSKeyValueObserverRegistration)
 | 
			
		||||
 | 
			
		||||
/* Register or deregister as an observer of the value at a key path relative to the receiver. The options determine what is included in observer notifications and when they're sent, as described above, and the context is passed in observer notifications as described above. You should use -removeObserver:forKeyPath:context: instead of -removeObserver:forKeyPath: whenever possible because it allows you to more precisely specify your intent. When the same observer is registered for the same key path multiple times, but with different context pointers each time, -removeObserver:forKeyPath: has to guess at the context pointer when deciding what exactly to remove, and it can guess wrong.
 | 
			
		||||
*/
 | 
			
		||||
- (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(nullable void *)context;
 | 
			
		||||
- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath context:(nullable void *)context API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSArray<ObjectType>(NSKeyValueObserverRegistration)
 | 
			
		||||
 | 
			
		||||
/* Register or deregister as an observer of the values at a key path relative to each indexed element of the array. The options determine what is included in observer notifications and when they're sent, as described above, and the context is passed in observer notifications as described above. These are not merely convenience methods; invoking them is potentially much faster than repeatedly invoking NSObject(NSKeyValueObserverRegistration) methods. You should use -removeObserver:fromObjectsAtIndexes:forKeyPath:context: instead of -removeObserver:fromObjectsAtIndexes:forKeyPath: whenever possible for the same reason described in the NSObject(NSKeyValueObserverRegistration) comment.
 | 
			
		||||
*/
 | 
			
		||||
- (void)addObserver:(NSObject *)observer toObjectsAtIndexes:(NSIndexSet *)indexes forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(nullable void *)context;
 | 
			
		||||
- (void)removeObserver:(NSObject *)observer fromObjectsAtIndexes:(NSIndexSet *)indexes forKeyPath:(NSString *)keyPath context:(nullable void *)context API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)removeObserver:(NSObject *)observer fromObjectsAtIndexes:(NSIndexSet *)indexes forKeyPath:(NSString *)keyPath;
 | 
			
		||||
 | 
			
		||||
/* NSArrays are not observable, so these methods raise exceptions when invoked on NSArrays. Instead of observing an array, observe the ordered to-many relationship for which the array is the collection of related objects.
 | 
			
		||||
*/
 | 
			
		||||
- (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(nullable void *)context;
 | 
			
		||||
- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath context:(nullable void *)context API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSOrderedSet<ObjectType>(NSKeyValueObserverRegistration)
 | 
			
		||||
 | 
			
		||||
/* NSOrderedSets are not observable, so these methods raise exceptions when invoked on NSOrderedSets. Instead of observing an ordered set, observe the ordered to-many relationship for which the ordered set is the collection of related objects.
 | 
			
		||||
*/
 | 
			
		||||
- (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(nullable void *)context;
 | 
			
		||||
- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath context:(nullable void *)context API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSSet<ObjectType>(NSKeyValueObserverRegistration)
 | 
			
		||||
 | 
			
		||||
/* NSSets are not observable, so these methods raise exceptions when invoked on NSSets. Instead of observing a set, observe the unordered to-many relationship for which the set is the collection of related objects.
 | 
			
		||||
*/
 | 
			
		||||
- (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(nullable void *)context;
 | 
			
		||||
- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath context:(nullable void *)context API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSObject(NSKeyValueObserverNotification)
 | 
			
		||||
 | 
			
		||||
/* Given a key that identifies a property (attribute, to-one relationship, or ordered or unordered to-many relationship), send -observeValueForKeyPath:ofObject:change:context: notification messages of kind NSKeyValueChangeSetting to each observer registered for the key, including those that are registered with other objects using key paths that locate the keyed value in this object. Invocations of these methods must always be paired.
 | 
			
		||||
 | 
			
		||||
The change dictionaries in notifications resulting from use of these methods contain optional entries if requested at observer registration time:
 | 
			
		||||
    - The NSKeyValueChangeOldKey entry, if present, contains the value returned by -valueForKey: at the instant that -willChangeValueForKey: is invoked (or an NSNull if -valueForKey: returns nil).
 | 
			
		||||
    - The NSKeyValueChangeNewKey entry, if present, contains the value returned by -valueForKey: at the instant that -didChangeValueForKey: is invoked (or an NSNull if -valueForKey: returns nil).
 | 
			
		||||
*/
 | 
			
		||||
- (void)willChangeValueForKey:(NSString *)key;
 | 
			
		||||
- (void)didChangeValueForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Given a key that identifies an _ordered_ to-many relationship, send -observeValueForKeyPath:ofObject:change:context: notification messages of the passed-in change kind to each observer registered for the key, including those that are registered with other objects using key paths that locate the keyed value in this object. The passed-in kind must be NSKeyValueChangeInsertion, NSKeyValueChangeRemoval, or NSKeyValueChangeReplacement. The passed-in index set must be the indexes of the objects being inserted, removed, or replaced. Invocations of these methods must always be paired, with identical arguments.
 | 
			
		||||
 | 
			
		||||
The change dictionaries in notifications resulting from use of these methods contain optional entries if requested at observer registration time:
 | 
			
		||||
    - The NSKeyValueChangeOldKey entry, if present (only for NSKeyValueChangeRemoval and NSKeyValueChangeReplacement), contains an array of the indexed objects from the array returned by -valueForKey: at the instant that -willChangeValueForKey:valuesAtIndexes:forKey: is invoked.
 | 
			
		||||
    - The NSKeyValueChangeNewKey entry, if present (only for NSKeyValueChangeInsertion and NSKeyValueChangeReplacement), contains an array of the indexed objects from the array returned by -valueForKey: at the instant that -didChangeValueForKey:valuesAtIndexes:forKey: is invoked.
 | 
			
		||||
*/
 | 
			
		||||
- (void)willChange:(NSKeyValueChange)changeKind valuesAtIndexes:(NSIndexSet *)indexes forKey:(NSString *)key;
 | 
			
		||||
- (void)didChange:(NSKeyValueChange)changeKind valuesAtIndexes:(NSIndexSet *)indexes forKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Given a key that identifies an _unordered_ to-many relationship, send -observeValueForKeyPath:ofObject:change:context: notification messages to each observer registered for the key, including those that are registered with other objects using key paths that locate the keyed value in this object. The passed-in mutation kind corresponds to an NSMutableSet method. The passed-in set must contain the set that would be passed to the corresponding NSMutableSet method. Invocations of these methods must always be paired, with identical arguments.
 | 
			
		||||
 | 
			
		||||
The value of the NSKeyValueChangeKindKey entry in change dictionaries in notifications resulting from use of these methods depends on the passed-in mutationKind value:
 | 
			
		||||
    - NSKeyValueUnionSetMutation -> NSKeyValueChangeInsertion
 | 
			
		||||
    - NSKeyValueMinusSetMutation -> NSKeyValueChangeRemoval
 | 
			
		||||
    - NSKeyValueIntersectSetMutation -> NSKeyValueChangeRemoval
 | 
			
		||||
    - NSKeyValueSetSetMutation -> NSKeyValueChangeReplacement
 | 
			
		||||
 | 
			
		||||
The change dictionaries may also contain optional entries:
 | 
			
		||||
    - The NSKeyValueChangeOldKey entry, if present (only for for NSKeyValueChangeRemoval and NSKeyValueChangeReplacement), contains the set of objects that were removed.
 | 
			
		||||
    - The NSKeyValueChangeNewKey entry, if present (only for NSKeyValueChangeInsertion and NSKeyValueChangeReplacement), contains the set of objects that were added.
 | 
			
		||||
*/
 | 
			
		||||
- (void)willChangeValueForKey:(NSString *)key withSetMutation:(NSKeyValueSetMutationKind)mutationKind usingObjects:(NSSet *)objects;
 | 
			
		||||
- (void)didChangeValueForKey:(NSString *)key withSetMutation:(NSKeyValueSetMutationKind)mutationKind usingObjects:(NSSet *)objects;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSObject(NSKeyValueObservingCustomization)
 | 
			
		||||
 | 
			
		||||
/* Return a set of key paths for properties whose values affect the value of the keyed property. When an observer for the key is registered with an instance of the receiving class, KVO itself automatically observes all of the key paths for the same instance, and sends change notifications for the key to the observer when the value for any of those key paths changes. The default implementation of this method searches the receiving class for a method whose name matches the pattern +keyPathsForValuesAffecting<Key>, and returns the result of invoking that method if it is found. So, any such method must return an NSSet too. If no such method is found, an NSSet that is computed from information provided by previous invocations of the now-deprecated +setKeys:triggerChangeNotificationsForDependentKey: method is returned, for backward binary compatibility.
 | 
			
		||||
 | 
			
		||||
This method and KVO's automatic use of it comprise a dependency mechanism that you can use instead of sending -willChangeValueForKey:/-didChangeValueForKey: messages for dependent, computed, properties.
 | 
			
		||||
 
 | 
			
		||||
You can override this method when the getter method of one of your properties computes a value to return using the values of other properties, including those that are located by key paths. Your override should typically invoke super and return a set that includes any members in the set that result from doing that (so as not to interfere with overrides of this method in superclasses).
 | 
			
		||||
 | 
			
		||||
You can't really override this method when you add a computed property to an existing class using a category, because you're not supposed to override methods in categories. In that case, implement a matching +keyPathsForValuesAffecting<Key> to take advantage of this mechanism.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSSet<NSString *> *)keyPathsForValuesAffectingValueForKey:(NSString *)key API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Return YES if the key-value observing machinery should automatically invoke -willChangeValueForKey:/-didChangeValueForKey:, -willChange:valuesAtIndexes:forKey:/-didChange:valuesAtIndexes:forKey:, or -willChangeValueForKey:withSetMutation:usingObjects:/-didChangeValueForKey:withSetMutation:usingObjects: whenever instances of the class receive key-value coding messages for the key, or mutating key-value coding-compliant methods for the key are invoked. Return NO otherwise. Starting in Mac OS 10.5, the default implementation of this method searches the receiving class for a method whose name matches the pattern +automaticallyNotifiesObserversOf<Key>, and returns the result of invoking that method if it is found. So, any such method must return BOOL too. If no such method is found YES is returned.
 | 
			
		||||
*/
 | 
			
		||||
+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* Take or return a pointer that identifies information about all of the observers that are registered with the receiver, the options that were used at registration-time, etc. The default implementation of these methods store observation info in a global dictionary keyed by the receivers' pointers. For improved performance, you can override these methods to store the opaque data pointer in an instance variable. Overrides of these methods must not attempt to send Objective-C messages to the passed-in observation info, including -retain and -release.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable) void *observationInfo NS_RETURNS_INNER_POINTER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
 | 
			
		||||
@interface NSObject(NSDeprecatedKeyValueObservingCustomization)
 | 
			
		||||
 | 
			
		||||
/* A method that was deprecated in Mac OS 10.5, in favor of using +keyPathsForValuesAffectingValueForKey:. Registers the fact that invocations of -willChangeValueForKey:/-didChangeValueForKey:, -willChange:valuesAtIndexes:forKey:/-didChange:valuesAtIndexes:forKey:, and -willChangeValueForKey:withSetMutation:usingObjects:/-didChangeValueForKey:withSetMutation:usingObjects: for any key in the passed-in array should also send notifications for the dependent key.
 | 
			
		||||
*/
 | 
			
		||||
+ (void)setKeys:(NSArray *)keys triggerChangeNotificationsForDependentKey:(NSString *)dependentKey API_DEPRECATED("Use +keyPathsForValuesAffectingValueForKey instead", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
@end 
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,295 @@
 | 
			
		||||
/*	NSKeyedArchiver.h
 | 
			
		||||
	Copyright (c) 2001-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSCoder.h>
 | 
			
		||||
#import <Foundation/NSPropertyList.h>
 | 
			
		||||
#import <Foundation/NSException.h>
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>, NSMutableData, NSData, NSString;
 | 
			
		||||
@protocol NSKeyedArchiverDelegate, NSKeyedUnarchiverDelegate;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSInvalidArchiveOperationException;
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSInvalidUnarchiveOperationException;
 | 
			
		||||
// Archives created using the class method archivedDataWithRootObject used this key for the root object in the hierarchy of encoded objects. The NSKeyedUnarchiver class method unarchiveObjectWithData: will look for this root key as well. You can also use it as the key for the root object in your own archives.
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSKeyedArchiveRootObjectKey API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@interface NSKeyedArchiver : NSCoder
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 Initializes the receiver for encoding an archive, optionally disabling secure coding.
 | 
			
		||||
 | 
			
		||||
 If \c NSSecureCoding cannot be used, \c requiresSecureCoding may be turned off here; for improved security, however, \c requiresSecureCoding should be left enabled whenever possible. \c requiresSecureCoding ensures that all encoded objects conform to \c NSSecureCoding, preventing the possibility of encoding objects which cannot be decoded later.
 | 
			
		||||
 | 
			
		||||
 To produce archives whose structure matches those previously encoded using \c +archivedDataWithRootObject, encode the top-level object in your archive for the \c NSKeyedArchiveRootObjectKey.
 | 
			
		||||
 */
 | 
			
		||||
- (instancetype)initRequiringSecureCoding:(BOOL)requiresSecureCoding API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 Returns an \c NSData object containing the encoded form of the object graph whose root object is given, optionally disabling secure coding.
 | 
			
		||||
 | 
			
		||||
 If \c NSSecureCoding cannot be used, \c requiresSecureCoding may be turned off here; for improved security, however, \c requiresSecureCoding should be left enabled whenever possible. \c requiresSecureCoding ensures that all encoded objects conform to \c NSSecureCoding, preventing the possibility of encoding objects which cannot be decoded later.
 | 
			
		||||
 | 
			
		||||
 If the object graph cannot be encoded, returns \c nil and sets the \c error out parameter.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable NSData *)archivedDataWithRootObject:(id)object requiringSecureCoding:(BOOL)requiresSecureCoding error:(NSError **)error API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
/// Initialize the archiver with empty data, ready for writing.
 | 
			
		||||
- (instancetype)init API_DEPRECATED("Use -initRequiringSecureCoding: instead", macosx(10.12,10.14), ios(10.0,12.0), watchos(3.0,5.0), tvos(10.0,12.0));
 | 
			
		||||
- (instancetype)initForWritingWithMutableData:(NSMutableData *)data API_DEPRECATED("Use -initRequiringSecureCoding: instead", macosx(10.2,10.14), ios(2.0,12.0), watchos(2.0,5.0), tvos(9.0,12.0));
 | 
			
		||||
 | 
			
		||||
+ (NSData *)archivedDataWithRootObject:(id)rootObject API_DEPRECATED("Use +archivedDataWithRootObject:requiringSecureCoding:error: instead", macosx(10.2,10.14), ios(2.0,12.0), watchos(2.0,5.0), tvos(9.0,12.0));
 | 
			
		||||
+ (BOOL)archiveRootObject:(id)rootObject toFile:(NSString *)path API_DEPRECATED("Use +archivedDataWithRootObject:requiringSecureCoding:error: and -writeToURL:options:error: instead", macosx(10.2,10.14), ios(2.0,12.0), watchos(2.0,5.0), tvos(9.0,12.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, assign) id <NSKeyedArchiverDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
@property NSPropertyListFormat outputFormat;
 | 
			
		||||
 | 
			
		||||
/// If encoding has not yet finished, then invoking this property will call finishEncoding and return the data. If you initialized the keyed archiver with a specific mutable data instance, then it will be returned from this property after finishEncoding is called.
 | 
			
		||||
@property (readonly, strong) NSData *encodedData API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
- (void)finishEncoding;
 | 
			
		||||
 | 
			
		||||
+ (void)setClassName:(nullable NSString *)codedName forClass:(Class)cls;
 | 
			
		||||
- (void)setClassName:(nullable NSString *)codedName forClass:(Class)cls;
 | 
			
		||||
	// During encoding, the coder first checks with the coder's
 | 
			
		||||
	// own table, then if there was no mapping there, the class's.
 | 
			
		||||
 | 
			
		||||
+ (nullable NSString *)classNameForClass:(Class)cls;
 | 
			
		||||
- (nullable NSString *)classNameForClass:(Class)cls;
 | 
			
		||||
 | 
			
		||||
- (void)encodeObject:(nullable id)object forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeConditionalObject:(nullable id)object forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeBool:(BOOL)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeInt:(int)value forKey:(NSString *)key;	// native int
 | 
			
		||||
- (void)encodeInt32:(int32_t)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeInt64:(int64_t)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeFloat:(float)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeDouble:(double)value forKey:(NSString *)key;
 | 
			
		||||
- (void)encodeBytes:(nullable const uint8_t *)bytes length:(NSUInteger)length forKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
// Enables secure coding support on this keyed archiver. You do not need to enable secure coding on the archiver to enable secure coding on the unarchiver. Enabling secure coding on the archiver is a way for you to be sure that all classes that are encoded conform with NSSecureCoding (it will throw an exception if a class which does not NSSecureCoding is archived). Note that the getter is on the superclass, NSCoder. See NSCoder for more information about secure coding.
 | 
			
		||||
@property (readwrite) BOOL requiresSecureCoding API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSKeyedUnarchiver : NSCoder
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 Initializes the receiver for decoding an archive previously encoded by \c NSKeyedUnarchiver.
 | 
			
		||||
 | 
			
		||||
 Enables \c requiresSecureCoding by default. If \c NSSecureCoding cannot be used, \c requiresSecureCoding may be turned off manually; for improved security, \c requiresSecureCoding should be left enabled whenever possible.
 | 
			
		||||
 | 
			
		||||
 Sets the unarchiver's \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
 Returns \c nil if the given data is not valid, and sets the \c error out parameter.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable instancetype)initForReadingFromData:(NSData *)data error:(NSError **)error API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 Decodes the root object of the given class from the given archive, previously encoded by \c NSKeyedArchiver.
 | 
			
		||||
 | 
			
		||||
 Enables \c requiresSecureCoding and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
 Returns \c nil if the given data is not valid or cannot be decoded, and sets the \c error out parameter.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable id)unarchivedObjectOfClass:(Class)cls fromData:(NSData *)data error:(NSError **)error API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 Decodes the \c NSArray root object from \c data which should be an \c NSArray<cls> containing the given non-collection class (no nested arrays or arrays of dictionaries, etc) from the given archive, previously encoded by \c NSKeyedArchiver.
 | 
			
		||||
 
 | 
			
		||||
 Enables \c requiresSecureCoding and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
 Returns \c nil if the given data is not valid or cannot be decoded, and sets the \c error out parameter.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable NSArray *)unarchivedArrayOfObjectsOfClass:(Class)cls fromData:(NSData *)data error:(NSError **)error API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
Decodes the \c NSDictionary root object from \c data which should be an \c NSDictionary<keyCls,objectCls>  with keys of type given in \c keyCls and objects of the given non-collection class \c objectCls (no nested dictionaries or other dictionaries contained in the dictionary, etc) from the given archive, previously encoded by \c NSKeyedArchiver.
 | 
			
		||||
 | 
			
		||||
Enables \c requiresSecureCoding and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
Returns \c nil if the given data is not valid or cannot be decoded, and sets the \c error out parameter.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSDictionary *)unarchivedDictionaryWithKeysOfClass:(Class)keyCls objectsOfClass:(Class)valueCls fromData:(NSData *)data error:(NSError **)error API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 Decodes the root object of one of the given classes from the given archive, previously encoded by \c NSKeyedArchiver.
 | 
			
		||||
 | 
			
		||||
 Enables \c requiresSecureCoding and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
 Returns \c nil if the given data is not valid or cannot be decoded, and sets the \c error out parameter.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable id)unarchivedObjectOfClasses:(NSSet<Class> *)classes fromData:(NSData *)data error:(NSError **)error API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
Decodes the \c NSArray root object from \c data which should be an \c NSArray, containing the given non-collection classes in \c classes  (no nested arrays or arrays of dictionaries, etc) from the given archive, previously encoded by \c NSKeyedArchiver.
 | 
			
		||||
 | 
			
		||||
Enables \c requiresSecureCoding and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
Returns \c nil if the given data is not valid or cannot be decoded, and sets the \c error out parameter.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSArray *)unarchivedArrayOfObjectsOfClasses:(NSSet<Class> *)classes fromData:(NSData *)data error:(NSError **)error API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
Decodes the \c NSDictionary root object from \c data which should be an \c NSDictionary, with keys of the types given in \c keyClasses and objects of the given non-collection classes in \c objectClasses (no nested dictionaries or other dictionaries contained in the dictionary, etc) from the given archive, previously encoded by \c NSKeyedArchiver.
 | 
			
		||||
 | 
			
		||||
Enables \c requiresSecureCoding and sets the \c decodingFailurePolicy to \c NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
 | 
			
		||||
Returns \c nil if the given data is not valid or cannot be decoded, and sets the \c error out parameter.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSDictionary *)unarchivedDictionaryWithKeysOfClasses:(NSSet<Class> *)keyClasses objectsOfClasses:(NSSet<Class> *)valueClasses fromData:(NSData *)data error:(NSError **)error API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)) NS_REFINED_FOR_SWIFT;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init API_DEPRECATED("Use -initForReadingFromData:error: instead", macosx(10.2,10.14), ios(2.0,12.0), watchos(2.0,5.0), tvos(9.0,12.0));
 | 
			
		||||
- (instancetype)initForReadingWithData:(NSData *)data API_DEPRECATED("Use -initForReadingFromData:error: instead", macosx(10.2,10.14), ios(2.0,12.0), watchos(2.0,5.0), tvos(9.0,12.0));
 | 
			
		||||
 | 
			
		||||
+ (nullable id)unarchiveObjectWithData:(NSData *)data API_DEPRECATED("Use +unarchivedObjectOfClass:fromData:error: instead", macosx(10.2,10.14), ios(2.0,12.0), watchos(2.0,5.0), tvos(9.0,12.0));
 | 
			
		||||
+ (nullable id)unarchiveTopLevelObjectWithData:(NSData *)data error:(NSError **)error API_DEPRECATED("Use +unarchivedObjectOfClass:fromData:error: instead", macosx(10.11,10.14), ios(2.0,12.0), watchos(2.0,5.0), tvos(9.0,12.0)) NS_SWIFT_UNAVAILABLE("Use 'unarchiveTopLevelObjectWithData(_:) throws' instead");
 | 
			
		||||
+ (nullable id)unarchiveObjectWithFile:(NSString *)path API_DEPRECATED("Use +unarchivedObjectOfClass:fromData:error: instead", macosx(10.2,10.14), ios(2.0,12.0), watchos(2.0,5.0), tvos(9.0,12.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, assign) id <NSKeyedUnarchiverDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
- (void)finishDecoding;
 | 
			
		||||
 | 
			
		||||
+ (void)setClass:(nullable Class)cls forClassName:(NSString *)codedName;
 | 
			
		||||
- (void)setClass:(nullable Class)cls forClassName:(NSString *)codedName;
 | 
			
		||||
	// During decoding, the coder first checks with the coder's
 | 
			
		||||
	// own table, then if there was no mapping there, the class's.
 | 
			
		||||
 | 
			
		||||
+ (nullable Class)classForClassName:(NSString *)codedName;
 | 
			
		||||
- (nullable Class)classForClassName:(NSString *)codedName;
 | 
			
		||||
 | 
			
		||||
- (BOOL)containsValueForKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
- (nullable id)decodeObjectForKey:(NSString *)key;
 | 
			
		||||
- (BOOL)decodeBoolForKey:(NSString *)key;
 | 
			
		||||
- (int)decodeIntForKey:(NSString *)key;		// may raise a range exception
 | 
			
		||||
- (int32_t)decodeInt32ForKey:(NSString *)key;
 | 
			
		||||
- (int64_t)decodeInt64ForKey:(NSString *)key;
 | 
			
		||||
- (float)decodeFloatForKey:(NSString *)key;
 | 
			
		||||
- (double)decodeDoubleForKey:(NSString *)key;
 | 
			
		||||
- (nullable const uint8_t *)decodeBytesForKey:(NSString *)key returnedLength:(nullable NSUInteger *)lengthp NS_RETURNS_INNER_POINTER;	// returned bytes immutable, and they go away with the unarchiver, not the containing autorelease pool
 | 
			
		||||
 | 
			
		||||
// Enables secure coding support on this keyed unarchiver. When enabled, unarchiving a disallowed class throws an exception. Once enabled, attempting to set requiresSecureCoding to NO will throw an exception. This is to prevent classes from selectively turning secure coding off. This is designed to be set once at the top level and remain on. Note that the getter is on the superclass, NSCoder. See NSCoder for more information about secure coding.
 | 
			
		||||
@property (readwrite) BOOL requiresSecureCoding API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (readwrite) NSDecodingFailurePolicy decodingFailurePolicy API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSKeyedArchiverDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
// substitution
 | 
			
		||||
- (nullable id)archiver:(NSKeyedArchiver *)archiver willEncodeObject:(id)object;
 | 
			
		||||
	// Informs the delegate that the object is about to be encoded.  The delegate
 | 
			
		||||
	// either returns this object or can return a different object to be encoded
 | 
			
		||||
	// instead.  The delegate can also fiddle with the coder state.  If the delegate
 | 
			
		||||
	// returns nil, nil is encoded.  This method is called after the original object
 | 
			
		||||
        // may have replaced itself with replacementObjectForKeyedArchiver:.
 | 
			
		||||
        // This method is not called for an object once a replacement mapping has been
 | 
			
		||||
        // setup for that object (either explicitly, or because the object has previously
 | 
			
		||||
        // been encoded).  This is also not called when nil is about to be encoded.
 | 
			
		||||
        // This method is called whether or not the object is being encoded conditionally.
 | 
			
		||||
 | 
			
		||||
- (void)archiver:(NSKeyedArchiver *)archiver didEncodeObject:(nullable id)object;
 | 
			
		||||
	// Informs the delegate that the given object has been encoded.  The delegate
 | 
			
		||||
	// might restore some state it had fiddled previously, or use this to keep
 | 
			
		||||
	// track of the objects which are encoded.  The object may be nil.  Not called
 | 
			
		||||
	// for conditional objects until they are really encoded (if ever).
 | 
			
		||||
 | 
			
		||||
// notification
 | 
			
		||||
- (void)archiver:(NSKeyedArchiver *)archiver willReplaceObject:(nullable id)object withObject:(nullable id)newObject;
 | 
			
		||||
	// Informs the delegate that the newObject is being substituted for the
 | 
			
		||||
	// object. This is also called when the delegate itself is doing/has done
 | 
			
		||||
	// the substitution. The delegate may use this method if it is keeping track
 | 
			
		||||
	// of the encoded or decoded objects.
 | 
			
		||||
 | 
			
		||||
- (void)archiverWillFinish:(NSKeyedArchiver *)archiver;
 | 
			
		||||
	// Notifies the delegate that encoding is about to finish.
 | 
			
		||||
 | 
			
		||||
- (void)archiverDidFinish:(NSKeyedArchiver *)archiver;
 | 
			
		||||
	// Notifies the delegate that encoding has finished.
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSKeyedUnarchiverDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
// error handling
 | 
			
		||||
- (nullable Class)unarchiver:(NSKeyedUnarchiver *)unarchiver cannotDecodeObjectOfClassName:(NSString *)name originalClasses:(NSArray<NSString *> *)classNames;
 | 
			
		||||
	// Informs the delegate that the named class is not available during decoding.
 | 
			
		||||
	// The delegate may, for example, load some code to introduce the class to the
 | 
			
		||||
	// runtime and return it, or substitute a different class object.  If the
 | 
			
		||||
	// delegate returns nil, unarchiving aborts with an exception.  The first class
 | 
			
		||||
        // name string in the array is the class of the encoded object, the second is
 | 
			
		||||
        // the immediate superclass, and so on.
 | 
			
		||||
 | 
			
		||||
// substitution
 | 
			
		||||
- (nullable id)unarchiver:(NSKeyedUnarchiver *)unarchiver didDecodeObject:(nullable id) NS_RELEASES_ARGUMENT object NS_RETURNS_RETAINED;
 | 
			
		||||
	// Informs the delegate that the object has been decoded.  The delegate
 | 
			
		||||
	// either returns this object or can return a different object to replace
 | 
			
		||||
	// the decoded one.  The object may be nil.  If the delegate returns nil,
 | 
			
		||||
        // the decoded value will be unchanged (that is, the original object will be
 | 
			
		||||
        // decoded). The delegate may use this to keep track of the decoded objects.
 | 
			
		||||
 | 
			
		||||
// notification
 | 
			
		||||
- (void)unarchiver:(NSKeyedUnarchiver *)unarchiver willReplaceObject:(id)object withObject:(id)newObject;
 | 
			
		||||
	// Informs the delegate that the newObject is being substituted for the
 | 
			
		||||
	// object. This is also called when the delegate itself is doing/has done
 | 
			
		||||
	// the substitution. The delegate may use this method if it is keeping track
 | 
			
		||||
	// of the encoded or decoded objects.
 | 
			
		||||
 | 
			
		||||
- (void)unarchiverWillFinish:(NSKeyedUnarchiver *)unarchiver;
 | 
			
		||||
	// Notifies the delegate that decoding is about to finish.
 | 
			
		||||
 | 
			
		||||
- (void)unarchiverDidFinish:(NSKeyedUnarchiver *)unarchiver;
 | 
			
		||||
	// Notifies the delegate that decoding has finished.
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSObject (NSKeyedArchiverObjectSubstitution)
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly) Class classForKeyedArchiver;
 | 
			
		||||
	// Implemented by classes to substitute a new class for instances during
 | 
			
		||||
	// encoding.  The object will be encoded as if it were a member of the
 | 
			
		||||
	// returned class.  The results of this method are overridden by the archiver
 | 
			
		||||
        // class and instance name<->class encoding tables.  If nil is returned,
 | 
			
		||||
        // the result of this method is ignored.  This method returns the result of
 | 
			
		||||
	// [self classForArchiver] by default, NOT -classForCoder as might be
 | 
			
		||||
	// expected.  This is a concession to source compatibility.
 | 
			
		||||
 | 
			
		||||
- (nullable id)replacementObjectForKeyedArchiver:(NSKeyedArchiver *)archiver;
 | 
			
		||||
	// Implemented by classes to substitute new instances for the receiving
 | 
			
		||||
	// instance during encoding.  The returned object will be encoded instead
 | 
			
		||||
	// of the receiver (if different).  This method is called only if no
 | 
			
		||||
	// replacement mapping for the object has been set up in the archiver yet
 | 
			
		||||
        // (for example, due to a previous call of replacementObjectForKeyedArchiver:
 | 
			
		||||
        // to that object).  This method returns the result of
 | 
			
		||||
	// [self replacementObjectForArchiver:nil] by default, NOT
 | 
			
		||||
	// -replacementObjectForCoder: as might be expected.  This is a concession
 | 
			
		||||
	// to source compatibility.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
+ (NSArray<NSString *> *)classFallbacksForKeyedArchiver;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSObject (NSKeyedUnarchiverObjectSubstitution)
 | 
			
		||||
 | 
			
		||||
+ (Class)classForKeyedUnarchiver;
 | 
			
		||||
	// Implemented by classes to substitute a new class during decoding.
 | 
			
		||||
        // Objects of the class will be decoded as members of the returned
 | 
			
		||||
        // class.  This method overrides the results of the unarchiver's class and
 | 
			
		||||
        // instance name<->class encoding tables.  Returns self by default.
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,48 @@
 | 
			
		||||
/*      NSLengthFormatter.h
 | 
			
		||||
        Copyright (c) 2014-2019, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSLengthFormatterUnit) {
 | 
			
		||||
    NSLengthFormatterUnitMillimeter = 8,
 | 
			
		||||
    NSLengthFormatterUnitCentimeter = 9,
 | 
			
		||||
    NSLengthFormatterUnitMeter = 11,
 | 
			
		||||
    NSLengthFormatterUnitKilometer = 14,
 | 
			
		||||
    NSLengthFormatterUnitInch = (5 << 8) + 1,
 | 
			
		||||
    NSLengthFormatterUnitFoot = (5 << 8) + 2,
 | 
			
		||||
    NSLengthFormatterUnitYard = (5 << 8) + 3,
 | 
			
		||||
    NSLengthFormatterUnitMile = (5 << 8) + 4,
 | 
			
		||||
} API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSLengthFormatter : NSFormatter {
 | 
			
		||||
@private
 | 
			
		||||
    void *_formatter;
 | 
			
		||||
    BOOL _isForPersonHeight;
 | 
			
		||||
    void *_reserved[2];
 | 
			
		||||
}
 | 
			
		||||
@property (null_resettable, copy) NSNumberFormatter *numberFormatter;    // default is NSNumberFormatter with NSNumberFormatterDecimalStyle
 | 
			
		||||
@property NSFormattingUnitStyle unitStyle;              // default is NSFormattingUnitStyleMedium
 | 
			
		||||
 | 
			
		||||
@property (getter = isForPersonHeightUse) BOOL forPersonHeightUse;  // default is NO; if it is set to YES, the number argument for -stringFromMeters: and -unitStringFromMeters: is considered as a person's height
 | 
			
		||||
 | 
			
		||||
// Format a combination of a number and an unit to a localized string.
 | 
			
		||||
- (NSString *)stringFromValue:(double)value unit:(NSLengthFormatterUnit)unit;
 | 
			
		||||
 | 
			
		||||
// Format a number in meters to a localized string with the locale-appropriate unit and an appropriate scale (e.g. 4.3m = 14.1ft in the US locale).
 | 
			
		||||
- (NSString *)stringFromMeters:(double)numberInMeters;
 | 
			
		||||
 | 
			
		||||
// Return a localized string of the given unit, and if the unit is singular or plural is based on the given number.
 | 
			
		||||
- (NSString *)unitStringFromValue:(double)value unit:(NSLengthFormatterUnit)unit;
 | 
			
		||||
 | 
			
		||||
// Return the locale-appropriate unit, the same unit used by -stringFromMeters:.
 | 
			
		||||
- (NSString *)unitStringFromMeters:(double)numberInMeters usedUnit:(nullable NSLengthFormatterUnit *)unitp;
 | 
			
		||||
 | 
			
		||||
// No parsing is supported. This method will return NO.
 | 
			
		||||
- (BOOL)getObjectValue:(out id _Nullable * _Nullable)obj forString:(NSString *)string errorDescription:(out NSString * _Nullable * _Nullable)error;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,168 @@
 | 
			
		||||
/*	NSLinguisticTagger.h
 | 
			
		||||
	Copyright (c) 2009-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>, NSOrthography, NSValue;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* NSLinguisticTagger is a class used to automatically segment natural-language text and tag the tokens with information such as language, script, lemma, and part of speech.  An instance of this class is assigned a string to tag, and clients can then obtain tags and ranges for tokens in that string appropriate to a given tag scheme and unit.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Tag schemes */
 | 
			
		||||
typedef NSString *NSLinguisticTagScheme NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeTokenType API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));              /* This tag scheme classifies tokens according to their broad general type:  word, punctuation, whitespace, etc. */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeLexicalClass API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));              /* This tag scheme classifies tokens according to class:  part of speech for words, type of punctuation or whitespace, etc. */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeNameType API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));              /* This tag scheme classifies tokens as to whether they are part of named entities of various types or not. */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeNameTypeOrLexicalClass API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));  /* This tag scheme follows NSLinguisticTagSchemeNameType for names, NSLinguisticTagSchemeLexicalClass for all other tokens. */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeLemma API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));              /* This tag scheme supplies a stem form for each word token (if known). */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeLanguage API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));              /* This tag scheme tags tokens according to their most likely language (if known). */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTagScheme const NSLinguisticTagSchemeScript API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));              /* This tag scheme tags tokens according to their script. */
 | 
			
		||||
 | 
			
		||||
typedef NSString *NSLinguisticTag NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
/* Tags for NSLinguisticTagSchemeTokenType */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagWord API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));                                     /* Tokens considered to be words or word-like linguistic items. */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagPunctuation API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));              /* Tokens made up of punctuation. */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagWhitespace API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));              /* Tokens made up of whitespace of all sorts. */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOther API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));                                     /* Other tokens, including non-linguistic items such as symbols. */
 | 
			
		||||
 | 
			
		||||
/* Tags for NSLinguisticTagSchemeLexicalClass */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagNoun API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagVerb API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagAdjective API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagAdverb API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagPronoun API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagDeterminer API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagParticle API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagPreposition API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagNumber API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagConjunction API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagInterjection API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagClassifier API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagIdiom API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOtherWord API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagSentenceTerminator API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOpenQuote API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagCloseQuote API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOpenParenthesis API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagCloseParenthesis API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagWordJoiner API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagDash API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOtherPunctuation API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagParagraphBreak API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOtherWhitespace API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* Tags for NSLinguisticTagSchemeNameType */
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagPersonalName API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagPlaceName API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
FOUNDATION_EXPORT NSLinguisticTag const NSLinguisticTagOrganizationName API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* For NSLinguisticTagSchemeTokenType, NSLinguisticTagSchemeLexicalClass, NSLinguisticTagSchemeNameType, and NSLinguisticTagSchemeNameTypeOrLexicalClass, tags will be taken from the lists above (clients may use == comparison).  Tags for NSLinguisticTagSchemeLemma are lemmas from the language.  Tags for NSLinguisticTagSchemeLanguage are standard language abbreviations.  Tags for NSLinguisticTagSchemeScript are standard script abbreviations.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* NSLinguisticTaggerUnit specifes the size of units in a string to which tagging applies.  The tagging unit may be word, sentence, paragraph, or document.  Methods that do not specify a unit act at the word level.  Not all combinations of scheme and unit are supported; clients can use +availableTagSchemesForUnit:language: to determine which ones are.
 | 
			
		||||
*/
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSLinguisticTaggerUnit) {
 | 
			
		||||
    NSLinguisticTaggerUnitWord,         /* Token units are at word or equivalent level */
 | 
			
		||||
    NSLinguisticTaggerUnitSentence,     /* Token units are at sentence level */
 | 
			
		||||
    NSLinguisticTaggerUnitParagraph,    /* Token units are at paragraph level */
 | 
			
		||||
    NSLinguisticTaggerUnitDocument      /* Token unit is the entire string */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Options arguments of type NSLinguisticTaggerOptions may include the following flags, which allow clients interested only in certain general types of tokens to specify that tokens of other types should be omitted from the returned results. */
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSLinguisticTaggerOptions) {   /* Any combination of options from the enumeration. */
 | 
			
		||||
    NSLinguisticTaggerOmitWords         = 1 << 0,       /* Omit tokens of type NSLinguisticTagWord. */
 | 
			
		||||
    NSLinguisticTaggerOmitPunctuation   = 1 << 1,       /* Omit tokens of type NSLinguisticTagPunctuation. */
 | 
			
		||||
    NSLinguisticTaggerOmitWhitespace    = 1 << 2,       /* Omit tokens of type NSLinguisticTagWhitespace. */
 | 
			
		||||
    NSLinguisticTaggerOmitOther         = 1 << 3,       /* Omit tokens of type NSLinguisticTagOther. */
 | 
			
		||||
    NSLinguisticTaggerJoinNames         = 1 << 4        /* Join tokens of tag scheme NSLinguisticTagSchemeNameType. */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED))
 | 
			
		||||
@interface NSLinguisticTagger : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    NSArray *_schemes;
 | 
			
		||||
    NSUInteger _options;
 | 
			
		||||
    NSString *_string;
 | 
			
		||||
    id _orthographyArray;
 | 
			
		||||
    id _tokenArray;
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* An instance of NSLinguisticTagger is created with an array of tag schemes.  The tagger will be able to supply tags corresponding to any of the schemes in this array.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithTagSchemes:(NSArray<NSLinguisticTagScheme> *)tagSchemes options:(NSUInteger)opts NS_DESIGNATED_INITIALIZER API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSLinguisticTagScheme> *tagSchemes API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
@property (nullable, retain) NSString *string API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* Clients wishing to know the tag schemes supported in NSLinguisticTagger for a particular unit and language may query them with this method.  The language should be specified using a standard BCP-47 language tag as with NSOrthography.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSArray<NSLinguisticTagScheme> *)availableTagSchemesForUnit:(NSLinguisticTaggerUnit)unit language:(NSString *)language API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.13, API_TO_BE_DEPRECATED), ios(11.0, API_TO_BE_DEPRECATED), watchos(4.0, API_TO_BE_DEPRECATED), tvos(11.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* Clients wishing to know the tag schemes supported in NSLinguisticTagger for a particular language at the word level may query them with this method.  The language should be specified using a standard abbreviation as with NSOrthography.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSArray<NSLinguisticTagScheme> *)availableTagSchemesForLanguage:(NSString *)language API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* If clients know the orthography for a given portion of the string, they may supply it to the tagger.  Otherwise, the tagger will infer the language from the contents of the text.  In each case, the charIndex or range passed in must not extend beyond the end of the tagger's string, or the methods will raise an exception.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setOrthography:(nullable NSOrthography *)orthography range:(NSRange)range API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (nullable NSOrthography *)orthographyAtIndex:(NSUInteger)charIndex effectiveRange:(nullable NSRangePointer)effectiveRange API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* If the string attached to the tagger is mutable, this method must be called to inform the tagger whenever the string changes.  The newRange is the range in the final string which was explicitly edited, and delta is the change in length from the previous version to the current version of the string.  Alternatively, the client may call setString: again to reset all information about the string, but this has the disadvantage of not preserving information about portions of the string that have not changed.
 | 
			
		||||
*/
 | 
			
		||||
- (void)stringEditedInRange:(NSRange)newRange changeInLength:(NSInteger)delta API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* Returns the range corresponding to the token for the given unit that contains the given character index.
 | 
			
		||||
*/
 | 
			
		||||
- (NSRange)tokenRangeAtIndex:(NSUInteger)charIndex unit:(NSLinguisticTaggerUnit)unit API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.13, API_TO_BE_DEPRECATED), ios(11.0, API_TO_BE_DEPRECATED), watchos(4.0, API_TO_BE_DEPRECATED), tvos(11.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* Returns a range covering all sentences intersecting the given range.
 | 
			
		||||
*/
 | 
			
		||||
- (NSRange)sentenceRangeForRange:(NSRange)range API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* The tagger will segment the string as needed into tokens for the given unit, and return those ranges along with a tag for any scheme in its array of tag schemes.  The fundamental tagging method on NSLinguisticTagger is a block iterator, that iterates over all tokens intersecting a given range, supplying tags and ranges.  There are several additional convenience methods, for obtaining a sentence range, information about a single token, or for obtaining information about all tokens intersecting a given range at once, in arrays.  In each case, the charIndex or range passed in must not extend beyond the end of the tagger's string, or the methods will raise an exception.  Note that a given instance of NSLinguisticTagger should not be used from more than one thread simultaneously.
 | 
			
		||||
*/
 | 
			
		||||
- (void)enumerateTagsInRange:(NSRange)range unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options usingBlock:(void (NS_NOESCAPE ^)(NSLinguisticTag _Nullable tag, NSRange tokenRange, BOOL *stop))block API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.13, API_TO_BE_DEPRECATED), ios(11.0, API_TO_BE_DEPRECATED), watchos(4.0, API_TO_BE_DEPRECATED), tvos(11.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (nullable NSLinguisticTag)tagAtIndex:(NSUInteger)charIndex unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme tokenRange:(nullable NSRangePointer)tokenRange API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.13, API_TO_BE_DEPRECATED), ios(11.0, API_TO_BE_DEPRECATED), watchos(4.0, API_TO_BE_DEPRECATED), tvos(11.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (NSArray<NSLinguisticTag> *)tagsInRange:(NSRange)range unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options tokenRanges:(NSArray<NSValue *> * _Nullable * _Nullable)tokenRanges API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.13, API_TO_BE_DEPRECATED), ios(11.0, API_TO_BE_DEPRECATED), watchos(4.0, API_TO_BE_DEPRECATED), tvos(11.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* Methods that do not specify a unit act at the word level.
 | 
			
		||||
*/
 | 
			
		||||
- (void)enumerateTagsInRange:(NSRange)range scheme:(NSLinguisticTagScheme)tagScheme options:(NSLinguisticTaggerOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSLinguisticTag _Nullable tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop))block API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (nullable NSLinguisticTag)tagAtIndex:(NSUInteger)charIndex scheme:(NSLinguisticTagScheme)scheme tokenRange:(nullable NSRangePointer)tokenRange sentenceRange:(nullable NSRangePointer)sentenceRange API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (NSArray<NSString *> *)tagsInRange:(NSRange)range scheme:(NSString *)tagScheme options:(NSLinguisticTaggerOptions)opts tokenRanges:(NSArray<NSValue *> * _Nullable * _Nullable)tokenRanges API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* Returns the top identified language (if any) for the entire string.  Convenience for tagAtIndex: with NSLinguisticTagSchemeLanguage and NSLinguisticTaggerUnitDocument.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *dominantLanguage API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.13, API_TO_BE_DEPRECATED), ios(11.0, API_TO_BE_DEPRECATED), watchos(4.0, API_TO_BE_DEPRECATED), tvos(11.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* The following class methods are conveniences for clients who wish to perform a single analysis on a string without having to create an instance of NSLinguisticTagger.  If more than one tagging operation is needed on a given string, it is more efficient to use an explicit NSLinguisticTagger instance.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSString *)dominantLanguageForString:(NSString *)string API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.13, API_TO_BE_DEPRECATED), ios(11.0, API_TO_BE_DEPRECATED), watchos(4.0, API_TO_BE_DEPRECATED), tvos(11.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
+ (nullable NSLinguisticTag)tagForString:(NSString *)string atIndex:(NSUInteger)charIndex unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme orthography:(nullable NSOrthography *)orthography tokenRange:(nullable NSRangePointer)tokenRange API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.13, API_TO_BE_DEPRECATED), ios(11.0, API_TO_BE_DEPRECATED), watchos(4.0, API_TO_BE_DEPRECATED), tvos(11.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
+ (NSArray<NSLinguisticTag> *)tagsForString:(NSString *)string range:(NSRange)range unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options orthography:(nullable NSOrthography *)orthography tokenRanges:(NSArray<NSValue *> * _Nullable * _Nullable)tokenRanges API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.13, API_TO_BE_DEPRECATED), ios(11.0, API_TO_BE_DEPRECATED), watchos(4.0, API_TO_BE_DEPRECATED), tvos(11.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
+ (void)enumerateTagsForString:(NSString *)string range:(NSRange)range unit:(NSLinguisticTaggerUnit)unit scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options orthography:(nullable NSOrthography *)orthography usingBlock:(void (NS_NOESCAPE ^)(NSLinguisticTag _Nullable tag, NSRange tokenRange, BOOL *stop))block API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.13, API_TO_BE_DEPRECATED), ios(11.0, API_TO_BE_DEPRECATED), watchos(4.0, API_TO_BE_DEPRECATED), tvos(11.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
/* Deprecated method for obtaining a list of possible tags for the token at a given index.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSArray<NSString *> *)possibleTagsAtIndex:(NSUInteger)charIndex scheme:(NSString *)tagScheme tokenRange:(nullable NSRangePointer)tokenRange sentenceRange:(nullable NSRangePointer)sentenceRange scores:(NSArray<NSValue *> * _Nullable * _Nullable)scores API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSString (NSLinguisticAnalysis)
 | 
			
		||||
 | 
			
		||||
/* Clients wishing to analyze a given string once may use these NSString APIs without having to create an instance of NSLinguisticTagger.  If more than one tagging operation is needed on a given string, it is more efficient to use an explicit NSLinguisticTagger instance.
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray<NSLinguisticTag> *)linguisticTagsInRange:(NSRange)range scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options orthography:(nullable NSOrthography *)orthography tokenRanges:(NSArray<NSValue *> * _Nullable * _Nullable)tokenRanges API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
- (void)enumerateLinguisticTagsInRange:(NSRange)range scheme:(NSLinguisticTagScheme)scheme options:(NSLinguisticTaggerOptions)options orthography:(nullable NSOrthography *)orthography usingBlock:(void (NS_NOESCAPE ^)(NSLinguisticTag _Nullable tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop))block API_DEPRECATED("All NSLinguisticTagger API should be replaced with NaturalLanguage.framework API", macos(10.7, API_TO_BE_DEPRECATED), ios(5.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,48 @@
 | 
			
		||||
/*    NSListFormatter.h
 | 
			
		||||
      Copyright (c) 2018-2019, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSFormatter.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* NSListFormatter provides locale-correct formatting of a list of items using the appropriate separator and conjunction. Note that the list formatter is unaware of the context where the joined string will be used, e.g., in the beginning of the sentence or used as a standalone string in the UI, so it will not provide any sort of capitalization customization on the given items, but merely join them as-is. The string joined this way may not be grammatically correct when placed in a sentence, and it should only be used in a standalone manner.
 | 
			
		||||
*/
 | 
			
		||||
API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
 | 
			
		||||
@interface NSListFormatter : NSFormatter
 | 
			
		||||
#if !__OBJC2__
 | 
			
		||||
{
 | 
			
		||||
@private
 | 
			
		||||
    void * _listFormatter;
 | 
			
		||||
    NSLocale *_locale;
 | 
			
		||||
    NSFormatter *_itemFormatter;
 | 
			
		||||
}
 | 
			
		||||
#endif // !__OBJC2__
 | 
			
		||||
 | 
			
		||||
/* Specifies the locale to format the items. Defaults to autoupdatingCurrentLocale. Also resets to autoupdatingCurrentLocale on assignment of nil.
 | 
			
		||||
 */
 | 
			
		||||
@property (null_resettable, copy) NSLocale *locale;
 | 
			
		||||
 | 
			
		||||
/* Specifies how each object should be formatted. If not set, the object is formatted using its instance method in the following order: -descriptionWithLocale:, -localizedDescription, and -description.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, copy) NSFormatter *itemFormatter;
 | 
			
		||||
 | 
			
		||||
/* Convenience method to return a string constructed from an array of strings using the list format specific to the current locale. It is recommended to join only disjointed strings that are ready to display in a bullet-point list. Sentences, phrases with punctuations, and appositions may not work well when joined together.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSString *)localizedStringByJoiningStrings:(NSArray<NSString *> *)strings;
 | 
			
		||||
 | 
			
		||||
/* Convenience method for -stringForObjectValue:. Returns a string constructed from an array in the locale-aware format. Each item is formatted using the itemFormatter. If the itemFormatter does not apply to a particular item, the method will fall back to the item's -descriptionWithLocale: or -localizedDescription if implemented, or -description if not.
 | 
			
		||||
 | 
			
		||||
 Returns nil if `items` is nil or if the list formatter cannot generate a string representation for all items in the array.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSString *)stringFromItems:(NSArray *)items;
 | 
			
		||||
 | 
			
		||||
/* Inherited from NSFormatter. `obj` must be an instance of NSArray. Returns nil if `obj` is nil, not an instance of NSArray, or if the list formatter cannot generate a string representation for all objects in the array.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSString *)stringForObjectValue:(nullable id)obj;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,175 @@
 | 
			
		||||
/*	NSLocale.h
 | 
			
		||||
	Copyright (c) 2003-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <CoreFoundation/CFLocale.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
 | 
			
		||||
@class NSCalendar;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSLocaleKey NS_TYPED_ENUM;
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>, NSDictionary<KeyType, ObjectType>, NSString;
 | 
			
		||||
 | 
			
		||||
// Toll-free bridged with CFLocaleRef
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSLocale : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
- (nullable id)objectForKey:(NSLocaleKey)key;
 | 
			
		||||
 | 
			
		||||
- (nullable NSString *)displayNameForKey:(NSLocaleKey)key value:(id)value;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithLocaleIdentifier:(NSString *)string NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSLocale (NSExtendedLocale)
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *localeIdentifier;  // same as NSLocaleIdentifier
 | 
			
		||||
- (NSString *)localizedStringForLocaleIdentifier:(NSString *)localeIdentifier API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *languageCode API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
- (nullable NSString *)localizedStringForLanguageCode:(NSString *)languageCode API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSString *countryCode API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
- (nullable NSString *)localizedStringForCountryCode:(NSString *)countryCode API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSString *scriptCode API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
- (nullable NSString *)localizedStringForScriptCode:(NSString *)scriptCode API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSString *variantCode API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
- (nullable NSString *)localizedStringForVariantCode:(NSString *)variantCode API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSCharacterSet *exemplarCharacterSet API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *calendarIdentifier API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
- (nullable NSString *)localizedStringForCalendarIdentifier:(NSString *)calendarIdentifier API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSString *collationIdentifier API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
- (nullable NSString *)localizedStringForCollationIdentifier:(NSString *)collationIdentifier API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly) BOOL usesMetricSystem API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *decimalSeparator API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *groupingSeparator API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *currencySymbol API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSString *currencyCode API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
- (nullable NSString *)localizedStringForCurrencyCode:(NSString *)currencyCode API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *collatorIdentifier API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
- (nullable NSString *)localizedStringForCollatorIdentifier:(NSString *)collatorIdentifier API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *quotationBeginDelimiter API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *quotationEndDelimiter API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *alternateQuotationBeginDelimiter API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *alternateQuotationEndDelimiter API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSLocale (NSLocaleCreation)
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSLocale *autoupdatingCurrentLocale API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)); // generally you should use this property
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, copy) NSLocale *currentLocale;	// an object representing the user's current locale
 | 
			
		||||
@property (class, readonly, copy) NSLocale *systemLocale;	// the default generic root locale with little localization
 | 
			
		||||
 | 
			
		||||
+ (instancetype)localeWithLocaleIdentifier:(NSString *)ident API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (instancetype)init API_UNAVAILABLE(macos, ios, watchos, tvos);     /* do not invoke; not a valid initializer for this class */
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSLocale (NSLocaleGeneralInfo)
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *availableLocaleIdentifiers;
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *ISOLanguageCodes;
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *ISOCountryCodes;
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *ISOCurrencyCodes;
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *commonISOCurrencyCodes API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *preferredLanguages API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)); // note that this list does not indicate what language the app is actually running in; the NSBundle.mainBundle object determines that at launch and knows that information
 | 
			
		||||
 | 
			
		||||
+ (NSDictionary<NSString *, NSString *> *)componentsFromLocaleIdentifier:(NSString *)string;
 | 
			
		||||
+ (NSString *)localeIdentifierFromComponents:(NSDictionary<NSString *, NSString *> *)dict;
 | 
			
		||||
 | 
			
		||||
+ (NSString *)canonicalLocaleIdentifierFromString:(NSString *)string;
 | 
			
		||||
+ (NSString *)canonicalLanguageIdentifierFromString:(NSString *)string;
 | 
			
		||||
 | 
			
		||||
+ (nullable NSString *)localeIdentifierFromWindowsLocaleCode:(uint32_t)lcid API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (uint32_t)windowsLocaleCodeFromLocaleIdentifier:(NSString *)localeIdentifier API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSLocaleLanguageDirection) {
 | 
			
		||||
    NSLocaleLanguageDirectionUnknown = kCFLocaleLanguageDirectionUnknown,
 | 
			
		||||
    NSLocaleLanguageDirectionLeftToRight = kCFLocaleLanguageDirectionLeftToRight,
 | 
			
		||||
    NSLocaleLanguageDirectionRightToLeft = kCFLocaleLanguageDirectionRightToLeft,
 | 
			
		||||
    NSLocaleLanguageDirectionTopToBottom = kCFLocaleLanguageDirectionTopToBottom,
 | 
			
		||||
    NSLocaleLanguageDirectionBottomToTop = kCFLocaleLanguageDirectionBottomToTop
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
+ (NSLocaleLanguageDirection)characterDirectionForLanguage:(NSString *)isoLangCode API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (NSLocaleLanguageDirection)lineDirectionForLanguage:(NSString *)isoLangCode API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSCurrentLocaleDidChangeNotification API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleIdentifier;		// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleLanguageCode;	// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleCountryCode;		// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleScriptCode;		// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleVariantCode;		// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleExemplarCharacterSet;// NSCharacterSet
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleCalendar;		// NSCalendar
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleCollationIdentifier; // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleUsesMetricSystem;	// NSNumber boolean
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleMeasurementSystem;	// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleDecimalSeparator;	// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleGroupingSeparator;	// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleCurrencySymbol;      // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleCurrencyCode;	// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleCollatorIdentifier API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));  // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleQuotationBeginDelimiterKey API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));	// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleQuotationEndDelimiterKey API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));	// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleAlternateQuotationBeginDelimiterKey API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));	// NSString
 | 
			
		||||
FOUNDATION_EXPORT NSLocaleKey const NSLocaleAlternateQuotationEndDelimiterKey API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));	// NSString
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if !defined(NS_CALENDAR_ENUM_DEPRECATED)
 | 
			
		||||
#if 1 || NS_ENABLE_CALENDAR_DEPRECATIONS
 | 
			
		||||
#define NS_CALENDAR_ENUM_DEPRECATED(A, B, C, D, ...) NS_ENUM_DEPRECATED(A, B, C, D, __VA_ARGS__)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED(A, B, C, D, ...) NS_DEPRECATED(A, B, C, D, __VA_ARGS__)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED_MAC(A, B, ...) NS_DEPRECATED_MAC(A, B, __VA_ARGS__)
 | 
			
		||||
#else
 | 
			
		||||
#define NS_CALENDAR_ENUM_DEPRECATED(A, B, C, D, ...) NS_ENUM_AVAILABLE(A, C)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED(A, B, C, D, ...) NS_AVAILABLE(A, C)
 | 
			
		||||
#define NS_CALENDAR_DEPRECATED_MAC(A, B, ...) NS_AVAILABLE_MAC(A)
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Values for NSCalendar identifiers (not the NSLocaleCalendar property key)
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSGregorianCalendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierGregorian", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSBuddhistCalendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierBuddhist", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSChineseCalendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierChinese", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSHebrewCalendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierHebrew", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSIslamicCalendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierIslamic", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSIslamicCivilCalendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierIslamicCivil", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSJapaneseCalendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierJapanese", macos(10.4, 10.10), ios(2.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSRepublicOfChinaCalendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierRepublicOfChina", macos(10.6, 10.10), ios(4.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSPersianCalendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierPersian", macos(10.6, 10.10), ios(4.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSIndianCalendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierIndian", macos(10.6, 10.10), ios(4.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSISO8601Calendar API_DEPRECATED_WITH_REPLACEMENT("NSCalendarIdentifierISO8601", macos(10.6, 10.10), ios(4.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,78 @@
 | 
			
		||||
/*	NSLock.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSDate;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@protocol NSLocking
 | 
			
		||||
 | 
			
		||||
- (void)lock;
 | 
			
		||||
- (void)unlock;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSLock : NSObject <NSLocking> {
 | 
			
		||||
@private
 | 
			
		||||
    void *_priv;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (BOOL)tryLock;
 | 
			
		||||
- (BOOL)lockBeforeDate:(NSDate *)limit;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSString *name API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSConditionLock : NSObject <NSLocking> {
 | 
			
		||||
@private
 | 
			
		||||
    void *_priv;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithCondition:(NSInteger)condition NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSInteger condition;
 | 
			
		||||
- (void)lockWhenCondition:(NSInteger)condition;
 | 
			
		||||
- (BOOL)tryLock;
 | 
			
		||||
- (BOOL)tryLockWhenCondition:(NSInteger)condition;
 | 
			
		||||
- (void)unlockWithCondition:(NSInteger)condition;
 | 
			
		||||
- (BOOL)lockBeforeDate:(NSDate *)limit;
 | 
			
		||||
- (BOOL)lockWhenCondition:(NSInteger)condition beforeDate:(NSDate *)limit;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSString *name API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSRecursiveLock : NSObject <NSLocking> {
 | 
			
		||||
@private
 | 
			
		||||
    void *_priv;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (BOOL)tryLock;
 | 
			
		||||
- (BOOL)lockBeforeDate:(NSDate *)limit;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSString *name API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSCondition : NSObject <NSLocking> {
 | 
			
		||||
@private
 | 
			
		||||
    void *_priv;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (void)wait;
 | 
			
		||||
- (BOOL)waitUntilDate:(NSDate *)limit;
 | 
			
		||||
- (void)signal;
 | 
			
		||||
- (void)broadcast;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSString *name API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,139 @@
 | 
			
		||||
/*	NSMapTable.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSPointerFunctions.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <Foundation/NSEnumerator.h>
 | 
			
		||||
 | 
			
		||||
#if !defined(__FOUNDATION_NSMAPTABLE__)
 | 
			
		||||
#define __FOUNDATION_NSMAPTABLE__ 1
 | 
			
		||||
 | 
			
		||||
@class NSArray, NSDictionary<KeyType, ObjectType>, NSMapTable;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/****************	Class	****************/
 | 
			
		||||
 | 
			
		||||
/* An NSMapTable is modeled after a dictionary, although, because of its options, is not a dictionary because it will behave differently.  The major option is to have keys and/or values held "weakly" in a manner that entries will be removed at some indefinite point after one of the objects is reclaimed.  In addition to being held weakly, keys or values may be copied on input or may use pointer identity for equality and hashing.
 | 
			
		||||
   An NSMapTable can also be configured to operate on arbitrary pointers and not just objects.  We recommend the C function API for "void *" access.  To configure for pointer use, consult and choose the appropriate NSPointerFunction options or configure and use  NSPointerFunctions objects directly for initialization.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
static const NSPointerFunctionsOptions NSMapTableStrongMemory API_AVAILABLE(macos(10.5), ios(6.0), watchos(2.0), tvos(9.0)) = NSPointerFunctionsStrongMemory;
 | 
			
		||||
static const NSPointerFunctionsOptions NSMapTableZeroingWeakMemory API_DEPRECATED("GC no longer supported", macos(10.5,10.8)) API_UNAVAILABLE(ios, watchos, tvos) = NSPointerFunctionsZeroingWeakMemory;
 | 
			
		||||
static const NSPointerFunctionsOptions NSMapTableCopyIn API_AVAILABLE(macos(10.5), ios(6.0), watchos(2.0), tvos(9.0)) = NSPointerFunctionsCopyIn;
 | 
			
		||||
static const NSPointerFunctionsOptions NSMapTableObjectPointerPersonality API_AVAILABLE(macos(10.5), ios(6.0), watchos(2.0), tvos(9.0)) = NSPointerFunctionsObjectPointerPersonality;
 | 
			
		||||
static const NSPointerFunctionsOptions NSMapTableWeakMemory API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)) = NSPointerFunctionsWeakMemory;
 | 
			
		||||
 | 
			
		||||
typedef NSUInteger NSMapTableOptions;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5), ios(6.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSMapTable<KeyType, ObjectType> : NSObject <NSCopying, NSSecureCoding, NSFastEnumeration>
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithKeyOptions:(NSPointerFunctionsOptions)keyOptions valueOptions:(NSPointerFunctionsOptions)valueOptions capacity:(NSUInteger)initialCapacity NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithKeyPointerFunctions:(NSPointerFunctions *)keyFunctions valuePointerFunctions:(NSPointerFunctions *)valueFunctions capacity:(NSUInteger)initialCapacity NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
+ (NSMapTable<KeyType, ObjectType> *)mapTableWithKeyOptions:(NSPointerFunctionsOptions)keyOptions valueOptions:(NSPointerFunctionsOptions)valueOptions;
 | 
			
		||||
 | 
			
		||||
+ (id)mapTableWithStrongToStrongObjects API_DEPRECATED("GC no longer supported", macos(10.5,10.8)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
+ (id)mapTableWithWeakToStrongObjects API_DEPRECATED("GC no longer supported", macos(10.5,10.8)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
+ (id)mapTableWithStrongToWeakObjects API_DEPRECATED("GC no longer supported", macos(10.5,10.8)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
+ (id)mapTableWithWeakToWeakObjects API_DEPRECATED("GC no longer supported", macos(10.5,10.8)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
+ (NSMapTable<KeyType, ObjectType> *)strongToStrongObjectsMapTable API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (NSMapTable<KeyType, ObjectType> *)weakToStrongObjectsMapTable API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)); // entries are not necessarily purged right away when the weak key is reclaimed
 | 
			
		||||
+ (NSMapTable<KeyType, ObjectType> *)strongToWeakObjectsMapTable API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
+ (NSMapTable<KeyType, ObjectType> *)weakToWeakObjectsMapTable API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0)); // entries are not necessarily purged right away when the weak key or object is reclaimed
 | 
			
		||||
 | 
			
		||||
/* return an NSPointerFunctions object reflecting the functions in use.  This is a new autoreleased object that can be subsequently modified and/or used directly in the creation of other pointer "collections". */
 | 
			
		||||
@property (readonly, copy) NSPointerFunctions *keyPointerFunctions;
 | 
			
		||||
@property (readonly, copy) NSPointerFunctions *valuePointerFunctions;
 | 
			
		||||
 | 
			
		||||
- (nullable ObjectType)objectForKey:(nullable KeyType)aKey;
 | 
			
		||||
 | 
			
		||||
- (void)removeObjectForKey:(nullable KeyType)aKey;
 | 
			
		||||
- (void)setObject:(nullable ObjectType)anObject forKey:(nullable KeyType)aKey;   // add/replace value (CFDictionarySetValue, NSMapInsert)
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger count;
 | 
			
		||||
 | 
			
		||||
- (NSEnumerator<KeyType> *)keyEnumerator;
 | 
			
		||||
- (nullable NSEnumerator<ObjectType> *)objectEnumerator;
 | 
			
		||||
 | 
			
		||||
- (void)removeAllObjects;
 | 
			
		||||
 | 
			
		||||
- (NSDictionary<KeyType, ObjectType> *)dictionaryRepresentation;  // create a dictionary of contents
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/****************	void * Map table operations	****************/
 | 
			
		||||
 | 
			
		||||
typedef struct {NSUInteger _pi; NSUInteger _si; void * _Nullable _bs;} NSMapEnumerator;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT void NSFreeMapTable(NSMapTable *table);
 | 
			
		||||
FOUNDATION_EXPORT void NSResetMapTable(NSMapTable *table);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSCompareMapTables(NSMapTable *table1, NSMapTable *table2);
 | 
			
		||||
FOUNDATION_EXPORT NSMapTable *NSCopyMapTableWithZone(NSMapTable *table, NSZone * _Nullable zone);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSMapMember(NSMapTable *table, const void *key, void * _Nullable * _Nullable originalKey, void * _Nullable * _Nullable value);
 | 
			
		||||
FOUNDATION_EXPORT void * _Nullable NSMapGet(NSMapTable *table, const void * _Nullable key);
 | 
			
		||||
FOUNDATION_EXPORT void NSMapInsert(NSMapTable *table, const void * _Nullable key, const void * _Nullable value);
 | 
			
		||||
FOUNDATION_EXPORT void NSMapInsertKnownAbsent(NSMapTable *table, const void * _Nullable key, const void * _Nullable value);
 | 
			
		||||
FOUNDATION_EXPORT void * _Nullable NSMapInsertIfAbsent(NSMapTable *table, const void * _Nullable key, const void * _Nullable value);
 | 
			
		||||
FOUNDATION_EXPORT void NSMapRemove(NSMapTable *table, const void * _Nullable key);
 | 
			
		||||
FOUNDATION_EXPORT NSMapEnumerator NSEnumerateMapTable(NSMapTable *table);
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSNextMapEnumeratorPair(NSMapEnumerator *enumerator, void * _Nullable * _Nullable key, void * _Nullable * _Nullable value);
 | 
			
		||||
FOUNDATION_EXPORT void NSEndMapTableEnumeration(NSMapEnumerator *enumerator);
 | 
			
		||||
FOUNDATION_EXPORT NSUInteger NSCountMapTable(NSMapTable *table);
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSStringFromMapTable(NSMapTable *table);
 | 
			
		||||
FOUNDATION_EXPORT NSArray *NSAllMapTableKeys(NSMapTable *table);
 | 
			
		||||
FOUNDATION_EXPORT NSArray *NSAllMapTableValues(NSMapTable *table);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/****************     Legacy     ***************************************/
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    NSUInteger	(* _Nullable hash)(NSMapTable *table, const void *);
 | 
			
		||||
    BOOL	(* _Nullable isEqual)(NSMapTable *table, const void *, const void *);
 | 
			
		||||
    void	(* _Nullable retain)(NSMapTable *table, const void *);
 | 
			
		||||
    void	(* _Nullable release)(NSMapTable *table, void *);
 | 
			
		||||
    NSString 	* _Nullable (* _Nullable describe)(NSMapTable *table, const void *);
 | 
			
		||||
    const void	* _Nullable notAKeyMarker;
 | 
			
		||||
} NSMapTableKeyCallBacks;
 | 
			
		||||
    
 | 
			
		||||
#define NSNotAnIntMapKey	((const void *)NSIntegerMin)
 | 
			
		||||
#define NSNotAnIntegerMapKey	((const void *)NSIntegerMin)
 | 
			
		||||
#define NSNotAPointerMapKey	((const void *)UINTPTR_MAX)
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    void	(* _Nullable retain)(NSMapTable *table, const void *);
 | 
			
		||||
    void	(* _Nullable release)(NSMapTable *table, void *);
 | 
			
		||||
    NSString 	* _Nullable(* _Nullable describe)(NSMapTable *table, const void *);
 | 
			
		||||
} NSMapTableValueCallBacks;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSMapTable *NSCreateMapTableWithZone(NSMapTableKeyCallBacks keyCallBacks, NSMapTableValueCallBacks valueCallBacks, NSUInteger capacity, NSZone * _Nullable zone);
 | 
			
		||||
FOUNDATION_EXPORT NSMapTable *NSCreateMapTable(NSMapTableKeyCallBacks keyCallBacks, NSMapTableValueCallBacks valueCallBacks, NSUInteger capacity);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/****************	Common map table key callbacks	****************/
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSIntegerMapKeyCallBacks API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSNonOwnedPointerMapKeyCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSNonOwnedPointerOrNullMapKeyCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSNonRetainedObjectMapKeyCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSObjectMapKeyCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSOwnedPointerMapKeyCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableKeyCallBacks NSIntMapKeyCallBacks API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0, 2.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
 | 
			
		||||
/****************	Common map table value callbacks	****************/
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableValueCallBacks NSIntegerMapValueCallBacks API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableValueCallBacks NSNonOwnedPointerMapValueCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableValueCallBacks NSObjectMapValueCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableValueCallBacks NSNonRetainedObjectMapValueCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableValueCallBacks NSOwnedPointerMapValueCallBacks;
 | 
			
		||||
FOUNDATION_EXPORT const NSMapTableValueCallBacks NSIntMapValueCallBacks API_DEPRECATED("Not supported", macos(10.0,10.5), ios(2.0, 2.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
#endif // defined __FOUNDATION_NSMAPTABLE__
 | 
			
		||||
@@ -0,0 +1,48 @@
 | 
			
		||||
/*      NSMassFormatter.h
 | 
			
		||||
        Copyright (c) 2014-2019, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSFormatter.h>
 | 
			
		||||
 | 
			
		||||
@class NSNumberFormatter;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSMassFormatterUnit) {
 | 
			
		||||
    NSMassFormatterUnitGram = 11,
 | 
			
		||||
    NSMassFormatterUnitKilogram = 14,
 | 
			
		||||
    NSMassFormatterUnitOunce = (6 << 8) + 1,
 | 
			
		||||
    NSMassFormatterUnitPound = (6 << 8) + 2,
 | 
			
		||||
    NSMassFormatterUnitStone = (6 << 8) + 3,
 | 
			
		||||
} API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSMassFormatter : NSFormatter {
 | 
			
		||||
@private
 | 
			
		||||
    void *_formatter;
 | 
			
		||||
    BOOL _isForPersonMassUse;
 | 
			
		||||
    void *_reserved[2];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (null_resettable, copy) NSNumberFormatter *numberFormatter;    // default is NSNumberFormatter with NSNumberFormatterDecimalStyle
 | 
			
		||||
@property NSFormattingUnitStyle unitStyle;              // default is NSFormattingUnitStyleMedium
 | 
			
		||||
@property (getter = isForPersonMassUse) BOOL forPersonMassUse;  // default is NO; if it is set to YES, the number argument for -stringFromKilograms: and -unitStringFromKilograms: is considered as a person’s mass
 | 
			
		||||
 | 
			
		||||
// Format a combination of a number and an unit to a localized string.
 | 
			
		||||
- (NSString *)stringFromValue:(double)value unit:(NSMassFormatterUnit)unit;
 | 
			
		||||
 | 
			
		||||
// Format a number in kilograms to a localized string with the locale-appropriate unit and an appropriate scale (e.g. 1.2kg = 2.64lb in the US locale).
 | 
			
		||||
- (NSString *)stringFromKilograms:(double)numberInKilograms;
 | 
			
		||||
 | 
			
		||||
// Return a localized string of the given unit, and if the unit is singular or plural is based on the given number.
 | 
			
		||||
- (NSString *)unitStringFromValue:(double)value unit:(NSMassFormatterUnit)unit;
 | 
			
		||||
 | 
			
		||||
// Return the locale-appropriate unit, the same unit used by -stringFromKilograms:.
 | 
			
		||||
- (NSString *)unitStringFromKilograms:(double)numberInKilograms usedUnit:(nullable NSMassFormatterUnit *)unitp;
 | 
			
		||||
 | 
			
		||||
// No parsing is supported. This method will return NO.
 | 
			
		||||
- (BOOL)getObjectValue:(out id _Nullable * _Nullable)obj forString:(NSString *)string errorDescription:(out NSString * _Nullable * _Nullable)error;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,48 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSMeasurement.h
 | 
			
		||||
    Copyright (c) 2015-2019, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSUnit.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0))
 | 
			
		||||
@interface NSMeasurement<UnitType: NSUnit *> : NSObject<NSCopying, NSSecureCoding> {
 | 
			
		||||
@private
 | 
			
		||||
    UnitType _unit;
 | 
			
		||||
    double _doubleValue;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) UnitType unit;
 | 
			
		||||
@property (readonly) double doubleValue;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init API_UNAVAILABLE(macos, ios, watchos, tvos);
 | 
			
		||||
- (instancetype)initWithDoubleValue:(double)doubleValue unit:(UnitType)unit NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Given an NSUnit object, canBeConvertedToUnit: will check for dimensionality i.e. check the unit type (NSUnitAngle, NSUnitLength, NSUnitCustom, etc.) of the NSUnit object.  It will return YES if the unit type of the given unit is the same as the unit type of the unit within the NSMeasurement object and NO if not.
 | 
			
		||||
 Note: This method will return NO if given or called on a dimensionless unit.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)canBeConvertedToUnit:(NSUnit *)unit;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Given an NSUnit object, measurementByConvertingUnit: will first check for dimensionality i.e. check the unit type (NSUnitAngle, NSUnitLength, NSUnitCustom, etc.) of the NSUnit object.  If the unit type of the given unit is not the same as the unit type of the unit within the NSMeasurement object (i.e. the units are of differing dimensionalities), measurementByConvertingToUnit: will throw an InvalidArgumentException.
 | 
			
		||||
 | 
			
		||||
 @return A new NSMeasurement object with the given unit and converted value.
 | 
			
		||||
 */
 | 
			
		||||
- (NSMeasurement *)measurementByConvertingToUnit:(NSUnit *)unit;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Given an NSMeasurement object, these methods will first check for dimensionality i.e. check the unit type (NSUnitAngle, NSUnitLength, NSUnitCustom, etc.) of the unit contained in that object.  If the unit type of the unit in the given NSMeasurement object is not the same as the unit type of the unit within the current NSMeasurement instance (i.e. the units are of differing dimensionalities), these methods will throw an InvalidArgumentException.
 | 
			
		||||
 
 | 
			
		||||
 @return A new NSMeasurement object with the adjusted value and a unit that is the same type as the current NSMeasurement instance.
 | 
			
		||||
 */
 | 
			
		||||
- (NSMeasurement<UnitType> *)measurementByAddingMeasurement:(NSMeasurement<UnitType> *)measurement;
 | 
			
		||||
- (NSMeasurement<UnitType> *)measurementBySubtractingMeasurement:(NSMeasurement<UnitType> *)measurement;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,70 @@
 | 
			
		||||
/*
 | 
			
		||||
 NSMeasurementFormatter.h
 | 
			
		||||
 Copyright (c) 2015-2019, Apple Inc.
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSFormatter.h>
 | 
			
		||||
#import <Foundation/NSNumberFormatter.h>
 | 
			
		||||
#import <Foundation/NSMeasurement.h>
 | 
			
		||||
#import <Foundation/NSLocale.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSMeasurementFormatterUnitOptions) {
 | 
			
		||||
    NSMeasurementFormatterUnitOptionsProvidedUnit = (1UL << 0),              // e.g  This ensures the formatter uses this unit even if it is not the preferred unit of the set locale.
 | 
			
		||||
    NSMeasurementFormatterUnitOptionsNaturalScale = (1UL << 1),              // e.g. This would make the formatter show "12 kilometers" instead of "12000 meters".  Note that setting NSMeasurementFormatterUnitOptionsNaturalScale results in scaling within the unit system of the preferred unit of the locale.  To scale within the unit system of the provided unit, set NSMeasurementFormatterUnitOptionsNaturalScale | NSMeasurementFormatterUnitOptionsProvidedUnit.
 | 
			
		||||
    NSMeasurementFormatterUnitOptionsTemperatureWithoutUnit = (1UL << 2),    // e.g. This would display "90°" rather than "90°F" or "90°C"
 | 
			
		||||
} API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0))
 | 
			
		||||
@interface NSMeasurementFormatter : NSFormatter <NSSecureCoding> {
 | 
			
		||||
@private
 | 
			
		||||
    void *_formatter;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 This property can be set to ensure that the formatter behaves in a way the developer expects, even if it is not standard according to the preferences of the user's locale. If not specified, unitOptions defaults to localizing according to the preferences of the locale.
 | 
			
		||||
 
 | 
			
		||||
 Ex:
 | 
			
		||||
 
 | 
			
		||||
 By default, if unitOptions is set to the empty set, the formatter will do the following:
 | 
			
		||||
    - kilocalories may be formatted as "C" instead of "kcal" depending on the locale.
 | 
			
		||||
    - kilometersPerHour may be formatted as "miles per hour" for US and UK locales but "kilometers per hour" for other locales.
 | 
			
		||||
 
 | 
			
		||||
 However, if NSMeasurementFormatterUnitOptionsProvidedUnit is set, the formatter will do the following:
 | 
			
		||||
    - kilocalories would be formatted as "kcal" in the language of the locale, even if the locale prefers "C".
 | 
			
		||||
    - kilometersPerHour would be formatted as "kilometers per hour" for US and UK locales even though the preference is for "miles per hour."
 | 
			
		||||
 | 
			
		||||
 Note that NSMeasurementFormatter will handle converting measurement objects to the preferred units in a particular locale.  For instance, if provided a measurement object in kilometers and the set locale is en_US, the formatter will implicitly convert the measurement object to miles and return the formatted string as the equivalent measurement in miles.
 | 
			
		||||
 | 
			
		||||
 */
 | 
			
		||||
@property NSMeasurementFormatterUnitOptions unitOptions;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 If not specified, unitStyle is set to NSFormattingUnitStyleMedium.
 | 
			
		||||
 */
 | 
			
		||||
@property NSFormattingUnitStyle unitStyle;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 If not specified, locale is set to the user's current locale.
 | 
			
		||||
 */
 | 
			
		||||
@property (null_resettable, copy) NSLocale *locale;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 If not specified, the number formatter is set up with NSNumberFormatterDecimalStyle.
 | 
			
		||||
 */
 | 
			
		||||
@property (null_resettable, copy) NSNumberFormatter *numberFormatter;
 | 
			
		||||
 | 
			
		||||
- (NSString *)stringFromMeasurement:(NSMeasurement *)measurement;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 @param An NSUnit
 | 
			
		||||
 @return A formatted string representing the localized form of the unit without a value attached to it.  This method will return [unit symbol] if the provided unit cannot be localized.
 | 
			
		||||
 */
 | 
			
		||||
- (NSString *)stringFromUnit:(NSUnit *)unit;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,162 @@
 | 
			
		||||
/*	NSMetadata.h
 | 
			
		||||
	Copyright (c) 2004-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSMetadataAttributes.h>
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSURL, NSArray<ObjectType>, NSDictionary<KeyType, ObjectType>, NSPredicate, NSOperationQueue, NSSortDescriptor;
 | 
			
		||||
@class NSMetadataItem, NSMetadataQueryAttributeValueTuple, NSMetadataQueryResultGroup;
 | 
			
		||||
@protocol NSMetadataQueryDelegate;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.4), ios(5.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSMetadataQuery : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    NSUInteger _flags;
 | 
			
		||||
    NSTimeInterval _interval;
 | 
			
		||||
    id _private[11];
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (nullable, assign) id<NSMetadataQueryDelegate> delegate;
 | 
			
		||||
@property (nullable, copy) NSPredicate *predicate;
 | 
			
		||||
@property (copy) NSArray<NSSortDescriptor *> *sortDescriptors;
 | 
			
		||||
@property (copy) NSArray<NSString *> *valueListAttributes;
 | 
			
		||||
@property (nullable, copy) NSArray<NSString *> *groupingAttributes;
 | 
			
		||||
@property NSTimeInterval notificationBatchingInterval;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSArray *searchScopes;
 | 
			
		||||
// scopes is an NSArray of NSURL objects (file URLs only) and/or string
 | 
			
		||||
// paths and/or the special string constants below, which specifies the
 | 
			
		||||
// locations to which the search is limited; an empty array means no
 | 
			
		||||
// limits, which is the default state.
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSArray *searchItems API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
// items can be a mixture of NSMetadataItem, NSURL objects (file URLs only)
 | 
			
		||||
// and/or string paths; the getter returns the same mixture as was set
 | 
			
		||||
 | 
			
		||||
@property (nullable, retain) NSOperationQueue *operationQueue API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
// optional operation queue for notifications and delegate method calls
 | 
			
		||||
 | 
			
		||||
- (BOOL)startQuery;
 | 
			
		||||
- (void)stopQuery;
 | 
			
		||||
 | 
			
		||||
@property (readonly, getter=isStarted) BOOL started;
 | 
			
		||||
@property (readonly, getter=isGathering) BOOL gathering;
 | 
			
		||||
@property (readonly, getter=isStopped) BOOL stopped;
 | 
			
		||||
 | 
			
		||||
- (void)disableUpdates; // these nest
 | 
			
		||||
- (void)enableUpdates;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Results are NSMetadataItems, or whatever the delegate replaces that with
 | 
			
		||||
@property (readonly) NSUInteger resultCount;
 | 
			
		||||
- (id)resultAtIndex:(NSUInteger)idx;
 | 
			
		||||
 | 
			
		||||
- (void)enumerateResultsUsingBlock:(void (NS_NOESCAPE ^)(id result, NSUInteger idx, BOOL *stop))block API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)enumerateResultsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(id result, NSUInteger idx, BOOL *stop))block API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray *results;   // this is for K-V Bindings, and causes side-effects on the query
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)indexOfResult:(id)result;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSDictionary<NSString *, NSArray<NSMetadataQueryAttributeValueTuple *> *> *valueLists; // values are arrays of NSMetadataQueryAttributeValueTuple
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSMetadataQueryResultGroup *> *groupedResults; // array of NSMetadataQueryResultGroups, for first grouping attribute
 | 
			
		||||
 | 
			
		||||
- (nullable id)valueOfAttribute:(NSString *)attrName forResultAtIndex:(NSUInteger)idx;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSMetadataQueryDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
- (id)metadataQuery:(NSMetadataQuery *)query replacementObjectForResultObject:(NSMetadataItem *)result;
 | 
			
		||||
- (id)metadataQuery:(NSMetadataQuery *)query replacementValueForAttribute:(NSString *)attrName value:(id)attrValue;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// notifications
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSMetadataQueryDidStartGatheringNotification API_AVAILABLE(macos(10.4), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSMetadataQueryGatheringProgressNotification API_AVAILABLE(macos(10.4), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSMetadataQueryDidFinishGatheringNotification API_AVAILABLE(macos(10.4), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSNotificationName const NSMetadataQueryDidUpdateNotification API_AVAILABLE(macos(10.4), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// keys for use with notification info dictionary
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryUpdateAddedItemsKey API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryUpdateChangedItemsKey API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryUpdateRemovedItemsKey API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryResultContentRelevanceAttribute API_AVAILABLE(macos(10.4), ios(5.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Scope constants for defined search locations
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryUserHomeScope API_AVAILABLE(macos(10.4)) API_UNAVAILABLE(ios, watchos, tvos); // user home directory
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryLocalComputerScope API_AVAILABLE(macos(10.4)) API_UNAVAILABLE(ios, watchos, tvos); // all local mounted volumes + user home (even if remote)
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryNetworkScope API_AVAILABLE(macos(10.4)) API_UNAVAILABLE(ios, watchos, tvos); // all user-mounted remote volumes
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryIndexedLocalComputerScope API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // all indexed local mounted volumes + user home (even if remote)
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryIndexedNetworkScope API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // all indexed user-mounted remote volumes
 | 
			
		||||
 | 
			
		||||
// -setSearchScopes: will throw an exception if the given array contains a mix of the scope constants below with constants above.
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryUbiquitousDocumentsScope API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // "Documents" subdirectory in the application's Ubiquity container
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryUbiquitousDataScope API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // application's Ubiquity container, excluding the "Documents" subdirectory
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); // documents from outside the application's container that are accessible without user interaction. NSMetadataItemURLKey attributes of results are security-scoped NSURLs.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.4), ios(5.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSMetadataItem : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    id _item;
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithURL:(NSURL *)url NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
- (nullable id)valueForAttribute:(NSString *)key;
 | 
			
		||||
- (nullable NSDictionary<NSString *, id> *)valuesForAttributes:(NSArray<NSString *> *)keys;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *attributes;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.4), ios(5.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSMetadataQueryAttributeValueTuple : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    id _attr;
 | 
			
		||||
    id _value;
 | 
			
		||||
    NSUInteger _count;
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *attribute;
 | 
			
		||||
@property (nullable, readonly, retain) id value;
 | 
			
		||||
@property (readonly) NSUInteger count;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.4), ios(5.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSMetadataQueryResultGroup : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    id _private[9];
 | 
			
		||||
    NSUInteger _private2[1];
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *attribute;
 | 
			
		||||
@property (readonly, retain) id value;
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSMetadataQueryResultGroup *> *subgroups; // nil if this is a leaf
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger resultCount;
 | 
			
		||||
- (id)resultAtIndex:(NSUInteger)idx; // uncertain whether this will do anything useful for non-leaf groups
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray *results;   // this is for K-V Bindings, and causes side-effects on the query
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,224 @@
 | 
			
		||||
/*	NSMetadataAttributes.h
 | 
			
		||||
        Copyright (c) 2004-2019, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSString;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
// The following NSMetadataItem attributes are available on Mac OS and iOS.
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemFSNameKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemDisplayNameKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemURLKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // NSURL
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemPathKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemFSSizeKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // file size in bytes; unsigned long long NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemFSCreationDateKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemFSContentChangeDateKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemContentTypeKey API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0)); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemContentTypeTreeKey API_AVAILABLE(macos(10.9), ios(8.0), watchos(2.0), tvos(9.0)); // NSArray of NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemIsUbiquitousKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // boolean NSNumber
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemHasUnresolvedConflictsKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemIsDownloadedKey API_DEPRECATED("Use NSMetadataUbiquitousItemDownloadingStatusKey instead", macos(10.7,10.9), ios(5.0,7.0), watchos(2.0,2.0), tvos(9.0,9.0)); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemDownloadingStatusKey API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)); // NSString ; download status of this item. The values are the three strings defined below:
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemDownloadingStatusNotDownloaded  API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)); // this item has not been downloaded yet. Use startDownloadingUbiquitousItemAtURL:error: to download it.
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemDownloadingStatusDownloaded     API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)); // there is a local version of this item available. The most current version will get downloaded as soon as possible.
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemDownloadingStatusCurrent        API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)); // there is a local version of this item and it is the most up-to-date version known to this device.
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemIsDownloadingKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemIsUploadedKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemIsUploadingKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemPercentDownloadedKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // double NSNumber; range [0..100]
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemPercentUploadedKey API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0)); // double NSNumber; range [0..100]
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemDownloadingErrorKey API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)); // NSError; the error when downloading the item from iCloud failed, see the NSUbiquitousFile section in FoundationErrors.h
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemUploadingErrorKey API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)); // NSError; the error when uploading the item to iCloud failed, see the NSUbiquitousFile section in FoundationErrors.h
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemDownloadRequestedKey API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemIsExternalDocumentKey API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemContainerDisplayNameKey API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemURLInLocalContainerKey API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); // NSURL
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousItemIsSharedKey API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos); // true if the ubiquitous item is shared. (value type boolean NSNumber)
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousSharedItemCurrentUserRoleKey API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos); // returns the current user's role for this shared item, or nil if not shared. (value type NSString). Possible values below.
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousSharedItemCurrentUserPermissionsKey API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos); // returns the permissions for the current user, or nil if not shared. (value type NSString). Possible values below.
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousSharedItemOwnerNameComponentsKey API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos); // returns a NSPersonNameComponents, or nil if the current user. (value type NSPersonNameComponents)
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousSharedItemMostRecentEditorNameComponentsKey API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos); // returns a NSPersonNameComponents for the most recent editor of the document, or nil if it is the current user. (Read-only, value type NSPersonNameComponents)
 | 
			
		||||
 | 
			
		||||
/* The values returned for the NSMetadataUbiquitousSharedItemCurrentUserRoleKey
 | 
			
		||||
 */
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousSharedItemRoleOwner API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos); // the current user is the owner of this shared item.
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousSharedItemRoleParticipant API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos); // the current user is a participant of this shared item.
 | 
			
		||||
 | 
			
		||||
/* The values returned for the NSMetadataUbiquitousSharedItemCurrentUserPermissionsKey
 | 
			
		||||
 */
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousSharedItemPermissionsReadOnly API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos); // the current user is only allowed to read this item
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataUbiquitousSharedItemPermissionsReadWrite API_AVAILABLE(macosx(10.12), ios(10.0)) API_UNAVAILABLE(watchos, tvos); // the current user is allowed to both read and write this item
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// The following NSMetadataItem attributes are available on Mac OS for non-ubiquitious items only. The constants are equal to the corresponding ones in <Metadata/MDItem.h>.
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAttributeChangeDateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemKeywordsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemTitleKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAuthorsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemEditorsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemParticipantsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemProjectsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemDownloadedDateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemWhereFromsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemCommentKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemCopyrightKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemLastUsedDateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemContentCreationDateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemContentModificationDateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemDateAddedKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemDurationSecondsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemContactKeywordsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemVersionKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemPixelHeightKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemPixelWidthKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemPixelCountKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemColorSpaceKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemBitsPerSampleKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemFlashOnOffKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemFocalLengthKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAcquisitionMakeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAcquisitionModelKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemISOSpeedKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemOrientationKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemLayerNamesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemWhiteBalanceKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemApertureKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemProfileNameKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemResolutionWidthDPIKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemResolutionHeightDPIKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemExposureModeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemExposureTimeSecondsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemEXIFVersionKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemCameraOwnerKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemFocalLength35mmKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemLensModelKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemEXIFGPSVersionKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAltitudeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemLatitudeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemLongitudeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemSpeedKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemTimestampKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSTrackKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemImageDirectionKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemNamedLocationKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSStatusKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSMeasureModeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSDOPKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSMapDatumKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSDestLatitudeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSDestLongitudeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSDestBearingKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSDestDistanceKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSProcessingMethodKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSAreaInformationKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSDateStampKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGPSDifferentalKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemCodecsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemMediaTypesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemStreamableKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemTotalBitRateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemVideoBitRateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAudioBitRateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemDeliveryTypeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAlbumKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemHasAlphaChannelKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemRedEyeOnOffKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemMeteringModeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemMaxApertureKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemFNumberKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemExposureProgramKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemExposureTimeStringKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemHeadlineKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemInstructionsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemCityKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemStateOrProvinceKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemCountryKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemTextContentKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAudioSampleRateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAudioChannelCountKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemTempoKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemKeySignatureKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemTimeSignatureKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAudioEncodingApplicationKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemComposerKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemLyricistKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAudioTrackNumberKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemRecordingDateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemMusicalGenreKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemIsGeneralMIDISequenceKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemRecordingYearKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemOrganizationsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemLanguagesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemRightsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemPublishersKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemContributorsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemCoverageKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemSubjectKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemThemeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemDescriptionKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemIdentifierKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAudiencesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemNumberOfPagesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemPageWidthKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemPageHeightKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemSecurityMethodKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemCreatorKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemEncodingApplicationsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemDueDateKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSDate
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemStarRatingKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemPhoneNumbersKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemEmailAddressesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemInstantMessageAddressesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemKindKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemRecipientsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemFinderCommentKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemFontsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAppleLoopsRootKeyKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAppleLoopsKeyFilterTypeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAppleLoopsLoopModeKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAppleLoopDescriptorsKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSStrings
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemMusicalInstrumentCategoryKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemMusicalInstrumentNameKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemCFBundleIdentifierKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemInformationKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemDirectorKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemProducerKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemGenreKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemPerformersKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemOriginalFormatKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemOriginalSourceKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAuthorEmailAddressesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemRecipientEmailAddressesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemAuthorAddressesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemRecipientAddressesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemIsLikelyJunkKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // boolean NSNumber
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemExecutableArchitecturesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemExecutablePlatformKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSString
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemApplicationCategoriesKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // NSArray of NSString
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSMetadataItemIsApplicationManagedKey API_AVAILABLE(macos(10.9)) API_UNAVAILABLE(ios, watchos, tvos); // boolean NSNumber
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,26 @@
 | 
			
		||||
/*	NSMethodSignature.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("NSInvocation and related APIs not available")
 | 
			
		||||
@interface NSMethodSignature : NSObject
 | 
			
		||||
 | 
			
		||||
+ (nullable NSMethodSignature *)signatureWithObjCTypes:(const char *)types;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger numberOfArguments;
 | 
			
		||||
- (const char *)getArgumentTypeAtIndex:(NSUInteger)idx NS_RETURNS_INNER_POINTER;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger frameLength;
 | 
			
		||||
 | 
			
		||||
- (BOOL)isOneway;
 | 
			
		||||
 | 
			
		||||
@property (readonly) const char *methodReturnType NS_RETURNS_INNER_POINTER;
 | 
			
		||||
@property (readonly) NSUInteger methodReturnLength;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,100 @@
 | 
			
		||||
/*    NSMorphology.h
 | 
			
		||||
      Copyright (c) 2021, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSError.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSGrammaticalGender) {
 | 
			
		||||
    NSGrammaticalGenderNotSet = 0,
 | 
			
		||||
    NSGrammaticalGenderFeminine,
 | 
			
		||||
    NSGrammaticalGenderMasculine,
 | 
			
		||||
    NSGrammaticalGenderNeuter,
 | 
			
		||||
} API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSGrammaticalPartOfSpeech) {
 | 
			
		||||
    NSGrammaticalPartOfSpeechNotSet = 0,
 | 
			
		||||
    NSGrammaticalPartOfSpeechDeterminer,
 | 
			
		||||
    NSGrammaticalPartOfSpeechPronoun,
 | 
			
		||||
    NSGrammaticalPartOfSpeechLetter,
 | 
			
		||||
    NSGrammaticalPartOfSpeechAdverb,
 | 
			
		||||
    NSGrammaticalPartOfSpeechParticle,
 | 
			
		||||
    NSGrammaticalPartOfSpeechAdjective,
 | 
			
		||||
    NSGrammaticalPartOfSpeechAdposition,
 | 
			
		||||
    NSGrammaticalPartOfSpeechVerb,
 | 
			
		||||
    NSGrammaticalPartOfSpeechNoun,
 | 
			
		||||
    NSGrammaticalPartOfSpeechConjunction,
 | 
			
		||||
    NSGrammaticalPartOfSpeechNumeral,
 | 
			
		||||
    NSGrammaticalPartOfSpeechInterjection,
 | 
			
		||||
    NSGrammaticalPartOfSpeechPreposition,
 | 
			
		||||
    NSGrammaticalPartOfSpeechAbbreviation,
 | 
			
		||||
} API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSGrammaticalNumber) {
 | 
			
		||||
    NSGrammaticalNumberNotSet = 0,
 | 
			
		||||
    NSGrammaticalNumberSingular,
 | 
			
		||||
    NSGrammaticalNumberZero,
 | 
			
		||||
    NSGrammaticalNumberPlural,
 | 
			
		||||
    NSGrammaticalNumberPluralTwo,
 | 
			
		||||
    NSGrammaticalNumberPluralFew,
 | 
			
		||||
    NSGrammaticalNumberPluralMany,
 | 
			
		||||
} API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
 | 
			
		||||
NS_REFINED_FOR_SWIFT
 | 
			
		||||
@interface NSMorphology: NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
@property (nonatomic) NSGrammaticalGender grammaticalGender;
 | 
			
		||||
@property (nonatomic) NSGrammaticalPartOfSpeech partOfSpeech;
 | 
			
		||||
@property (nonatomic) NSGrammaticalNumber number;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Per-language attribute support:
 | 
			
		||||
 | 
			
		||||
@class NSMorphologyCustomPronoun;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
 | 
			
		||||
@interface NSMorphology (NSCustomPronouns)
 | 
			
		||||
 | 
			
		||||
- (nullable NSMorphologyCustomPronoun *)customPronounForLanguage:(NSString *)language;
 | 
			
		||||
- (BOOL)setCustomPronoun:(nullable NSMorphologyCustomPronoun *)features forLanguage:(NSString *)language error:(NSError **)error;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
 | 
			
		||||
NS_REFINED_FOR_SWIFT
 | 
			
		||||
@interface NSMorphologyCustomPronoun: NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
+ (BOOL)isSupportedForLanguage:(NSString *)language;
 | 
			
		||||
+ (NSArray<NSString *> *)requiredKeysForLanguage:(NSString *)language;
 | 
			
		||||
 | 
			
		||||
@property(nullable, copy, nonatomic) NSString *subjectForm;
 | 
			
		||||
@property(nullable, copy, nonatomic) NSString *objectForm;
 | 
			
		||||
@property(nullable, copy, nonatomic) NSString *possessiveForm;
 | 
			
		||||
@property(nullable, copy, nonatomic) NSString *possessiveAdjectiveForm;
 | 
			
		||||
@property(nullable, copy, nonatomic) NSString *reflexiveForm;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// User settings access:
 | 
			
		||||
 | 
			
		||||
@interface NSMorphology (NSMorphologyUserSettings)
 | 
			
		||||
 | 
			
		||||
// Equivalent to the above.
 | 
			
		||||
@property (readonly, getter=isUnspecified) BOOL unspecified
 | 
			
		||||
 API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
@property (class, readonly) NSMorphology *userMorphology
 | 
			
		||||
 API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,330 @@
 | 
			
		||||
/*	NSNetServices.h
 | 
			
		||||
        Copyright (c) 2002-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
#import <Foundation/NSError.h>
 | 
			
		||||
#import <Foundation/NSRunLoop.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>, NSData, NSDictionary<KeyType, ObjectType>, NSInputStream, NSNumber, NSOutputStream, NSRunLoop, NSString;
 | 
			
		||||
@protocol NSNetServiceDelegate, NSNetServiceBrowserDelegate;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
#pragma mark Error constants
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString * const NSNetServicesErrorCode API_AVAILABLE(macos(10.2), ios(2.0), tvos(9.0)) API_UNAVAILABLE(watchos);
 | 
			
		||||
FOUNDATION_EXPORT NSErrorDomain const NSNetServicesErrorDomain API_AVAILABLE(macos(10.2), ios(2.0), tvos(9.0)) API_UNAVAILABLE(watchos);
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSNetServicesError) {
 | 
			
		||||
    
 | 
			
		||||
/* An unknown error occured during resolution or publication.
 | 
			
		||||
*/
 | 
			
		||||
    NSNetServicesUnknownError = -72000L,
 | 
			
		||||
    
 | 
			
		||||
/* An NSNetService with the same domain, type and name was already present when the publication request was made.
 | 
			
		||||
*/
 | 
			
		||||
    NSNetServicesCollisionError = -72001L,
 | 
			
		||||
    
 | 
			
		||||
/* The NSNetService was not found when a resolution request was made.
 | 
			
		||||
*/
 | 
			
		||||
    NSNetServicesNotFoundError	= -72002L,
 | 
			
		||||
    
 | 
			
		||||
/* A publication or resolution request was sent to an NSNetService instance which was already published or a search request was made of an NSNetServiceBrowser instance which was already searching.
 | 
			
		||||
*/
 | 
			
		||||
    NSNetServicesActivityInProgress = -72003L,
 | 
			
		||||
    
 | 
			
		||||
/* An required argument was not provided when initializing the NSNetService instance.
 | 
			
		||||
*/
 | 
			
		||||
    NSNetServicesBadArgumentError = -72004L,
 | 
			
		||||
    
 | 
			
		||||
/* The operation being performed by the NSNetService or NSNetServiceBrowser instance was cancelled.
 | 
			
		||||
*/
 | 
			
		||||
    NSNetServicesCancelledError = -72005L,
 | 
			
		||||
    
 | 
			
		||||
/* An invalid argument was provided when initializing the NSNetService instance or starting a search with an NSNetServiceBrowser instance.
 | 
			
		||||
*/
 | 
			
		||||
    NSNetServicesInvalidError = -72006L,
 | 
			
		||||
        
 | 
			
		||||
/* Resolution of an NSNetService instance failed because the timeout was reached.
 | 
			
		||||
*/
 | 
			
		||||
    NSNetServicesTimeoutError = -72007L,
 | 
			
		||||
    
 | 
			
		||||
/* Missing required configuration for local network access.
 | 
			
		||||
 *
 | 
			
		||||
 * NSBonjourServices and NSLocalNetworkUsageDescription are required in Info.plist
 | 
			
		||||
 */
 | 
			
		||||
    NSNetServicesMissingRequiredConfigurationError API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0)) API_UNAVAILABLE(watchos) = -72008L,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSNetServiceOptions) {
 | 
			
		||||
    /* When passed to -publishWithOptions:, this suppresses the auto-renaming of an
 | 
			
		||||
     * NSNetService in the event of a name collision. The collision is reported to the
 | 
			
		||||
     * instance's delegate on the -netService:didNotPublish: method.
 | 
			
		||||
     */
 | 
			
		||||
    NSNetServiceNoAutoRename = 1UL << 0,
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /* When passed to -publishWithOptions:, in addition to publishing the service, a
 | 
			
		||||
     * TCP listener is started for both IPv4 and IPv6 on the port specified by the
 | 
			
		||||
     * NSNetService. If the listening port can't be opened, an error is reported using
 | 
			
		||||
     * -netService:didNotPublish:. Specify a port number of zero to use a random port.
 | 
			
		||||
     * When -netServiceDidPublish: is called, -port will return the actual listening
 | 
			
		||||
     * port number. Since the listener only supports TCP, the publish will fail with
 | 
			
		||||
     * NSNetServicesBadArgumentError if the NSNetService type does not end with "_tcp".
 | 
			
		||||
     * New incoming connections will be delivered in the form of NSStreams via the
 | 
			
		||||
     * -netService:didAcceptConnectionWithInputStream:outputStream: delegate method.
 | 
			
		||||
     */
 | 
			
		||||
    NSNetServiceListenForConnections API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = 1UL << 1
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use nw_connection_t or nw_listener_t in Network framework instead", macos(10.2, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED)) API_UNAVAILABLE(watchos)
 | 
			
		||||
@interface NSNetService : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    id _netService;
 | 
			
		||||
    id _delegate;
 | 
			
		||||
    id _reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* This is the initializer for publishing. You should use this initializer if you are going to announce the availability of a service on the network. To publish a service in all available domains, pass the empty string as the domain.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithDomain:(NSString *)domain type:(NSString *)type name:(NSString *)name port:(int)port NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/* This is the initializer for resolution. If you know the domain, type and name of the service for which you wish to discover addresses, you should initialize an NSNetService instance using this method and call resolve: on the result. If you wish to connect to this service immediately, you should call getInputStream:getOutputStream: on the result and forego the resolution step entirely.
 | 
			
		||||
 | 
			
		||||
If publish: is called on an NSNetService instance initialized with this method, an NSNetServicesBadArgumentError will be sent in the error dictionary to the delegate's netService:didNotPublish: method.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithDomain:(NSString *)domain type:(NSString *)type name:(NSString *)name;
 | 
			
		||||
 | 
			
		||||
/* NSNetService instances may be scheduled on NSRunLoops to operate in different modes, or in other threads. It is generally not necessary to schedule NSNetServices in other threads. NSNetServices are scheduled in the current thread's NSRunLoop in the NSDefaultRunLoopMode when they are created.
 | 
			
		||||
*/
 | 
			
		||||
- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSRunLoopMode)mode;
 | 
			
		||||
- (void)removeFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSRunLoopMode)mode;
 | 
			
		||||
 | 
			
		||||
/* Set a delegate to receive publish, resolve, or monitor events.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, assign) id <NSNetServiceDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
/* Initially set to NO. Set to YES to also publish, resolve, or monitor this service over peer to peer Wi-Fi (if available). Must be set before operation starts.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL includesPeerToPeer API_AVAILABLE(macos(10.10), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* Returns the name of the discovered or published service.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSString *name;
 | 
			
		||||
 | 
			
		||||
/* Returns the type of the discovered or published service.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSString *type;
 | 
			
		||||
 | 
			
		||||
/* Returns the domain of the discovered or published service.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSString *domain;
 | 
			
		||||
 | 
			
		||||
/* Returns the DNS host name of the computer hosting the discovered or published service. If a successful resolve has not yet occurred, this method will return nil.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *hostName;
 | 
			
		||||
 | 
			
		||||
/* The addresses of the service. This is an NSArray of NSData instances, each of which contains a single struct sockaddr suitable for use with connect(2). In the event that no addresses are resolved for the service or the service has not yet been resolved, an empty NSArray is returned.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSData *> *addresses;
 | 
			
		||||
 | 
			
		||||
/* The port of a resolved service. This returns -1 if the service has not been resolved.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSInteger port API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 
 | 
			
		||||
/* Advertises a given service on the network. This method returns immediately. Success or failure is indicated by callbacks to the NSNetService instance's delegate.
 | 
			
		||||
 
 | 
			
		||||
    If the name of the service is the default name (@""), then the service will be renamed automatically. If the name of the service has been specified, then the service will not be renamed automatically. If more control over renaming is required, then -[NSNetService publishWithOptions:] is available.
 | 
			
		||||
*/
 | 
			
		||||
- (void)publish;
 | 
			
		||||
 | 
			
		||||
/* Advertises a given service on the network. This method returns immediately. Success or failure is indicated by callbacks to the NSNetService instance's delegate.
 | 
			
		||||
 
 | 
			
		||||
    See the notes above for NSNetServiceNoAutoRename for information about controlling the auto-renaming behavior using this method.
 | 
			
		||||
*/
 | 
			
		||||
- (void)publishWithOptions:(NSNetServiceOptions)options API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Attempts to determine at least one address for the NSNetService instance. For applications linked on or after Mac OS X 10.4 "Tiger", this method calls -resolveWithTimeout: with a value of 5.0. Applications linked prior to Mac OS X 10.4 "Tiger" must call -stop on the instance after an appropriate (short) amount of time to avoid causing unnecessary network traffic.
 | 
			
		||||
*/
 | 
			
		||||
- (void)resolve API_DEPRECATED("Not supported", macos(10.2,10.4), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
/* Halts a service which is either publishing or resolving.
 | 
			
		||||
*/
 | 
			
		||||
- (void)stop;
 | 
			
		||||
 | 
			
		||||
/* Returns an NSDictionary created from the provided NSData. The keys will be UTF8-encoded NSStrings. The values are NSDatas. The caller is responsible for interpreting these as types appropriate to the keys. If the NSData cannot be converted into an appropriate NSDictionary, this method will return nil. For applications linked on or after Mac OS X 10.5, this method will throw an NSInvalidException if it is passed nil as the argument.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSDictionary<NSString *, NSData *> *)dictionaryFromTXTRecordData:(NSData *)txtData;
 | 
			
		||||
 | 
			
		||||
/* Returns an NSData created from the provided dictionary. The keys in the provided dictionary must be NSStrings, and the values must be NSDatas. If the dictionary cannot be converted into an NSData suitable for a TXT record, this method will return nil. For applications linked on or after Mac OS X 10.5, this method will throw an NSInvalidArgumentException if it is passed nil as the argument.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSData *)dataFromTXTRecordDictionary:(NSDictionary<NSString *, NSData *> *)txtDictionary;
 | 
			
		||||
 | 
			
		||||
/* Starts a resolve for the NSNetService instance of the specified duration. If the delegate's -netServiceDidResolveAddress: method is called before the timeout expires, the resolve is successful. If the timeout is reached, the delegate's -netService:didNotResolve: method will be called. The value of the NSNetServicesErrorCode key in the error dictionary will be NSNetServicesTimeoutError.
 | 
			
		||||
*/
 | 
			
		||||
- (void)resolveWithTimeout:(NSTimeInterval)timeout;
 | 
			
		||||
 | 
			
		||||
/* Retrieves streams from the NSNetService instance. The instance's delegate methods are not called. Returns YES if the streams requested are created successfully. Returns NO if or any reason the stream could not be created. If only one stream is desired, pass NULL for the address of the other stream. The streams that are created are not open, and are not scheduled in any run loop for any mode.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)getInputStream:(out __strong NSInputStream * _Nullable * _Nullable)inputStream outputStream:(out __strong NSOutputStream * _Nullable * _Nullable)outputStream;
 | 
			
		||||
 | 
			
		||||
/* Sets the TXT record of the NSNetService instance that has been or will be published. Pass nil to remove the TXT record from the instance.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)setTXTRecordData:(nullable NSData *)recordData;
 | 
			
		||||
 | 
			
		||||
/* Returns the raw TXT record of the NSNetService instance. If the instance has not been resolved, or the delegate's -netService:didUpdateTXTRecordData: has not been called, this will return nil. It is permitted to have a zero-length TXT record.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSData *)TXTRecordData;
 | 
			
		||||
 | 
			
		||||
/* Starts monitoring the NSNetService instance for events. In Mac OS X 10.4 Tiger, monitored NSNetService instances inform their delegates of changes to the instance's TXT record by calling the delegate's -netService:didUpdateTXTRecordData: method.
 | 
			
		||||
*/
 | 
			
		||||
- (void)startMonitoring;
 | 
			
		||||
 | 
			
		||||
/* Stops monitoring the NSNetService instance for events.
 | 
			
		||||
*/
 | 
			
		||||
- (void)stopMonitoring;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use nw_browser_t in Network framework instead", macos(10.2, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED)) API_UNAVAILABLE(watchos)
 | 
			
		||||
@interface NSNetServiceBrowser : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    id _netServiceBrowser;
 | 
			
		||||
    id _delegate;
 | 
			
		||||
    void * _reserved;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (instancetype)init;
 | 
			
		||||
 | 
			
		||||
/* Set a delegate to receive discovery events.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, assign) id <NSNetServiceBrowserDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
/* Initially set to NO. Set to YES to also browse over peer to peer Wi-Fi (if available). Must be set before starting to search.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL includesPeerToPeer API_AVAILABLE(macos(10.10), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/* NSNetServiceBrowser instances may be scheduled on NSRunLoops to operate in different modes, or in other threads. It is generally not necessary to schedule NSNetServiceBrowsers in other threads. NSNetServiceBrowsers are scheduled in the current thread's NSRunLoop in the NSDefaultRunLoopMode when they are created.
 | 
			
		||||
*/
 | 
			
		||||
- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSRunLoopMode)mode;
 | 
			
		||||
- (void)removeFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSRunLoopMode)mode;
 | 
			
		||||
 | 
			
		||||
/* Starts a search for domains that are browsable via Bonjour and the computer's network configuration. Discovered domains are reported to the delegate's -netServiceBrowser:didFindDomain:moreComing: method. There may be more than one browsable domain.
 | 
			
		||||
*/
 | 
			
		||||
- (void)searchForBrowsableDomains;
 | 
			
		||||
 | 
			
		||||
/* Starts a search for domains in which the network configuration allows registration (i.e. publishing). Most NSNetServiceBrowser clients do not need to use this API, as it is sufficient to publish an NSNetService instance with the empty string (see -[NSNetService initWithDomain:type:name:port:]). Discovered domains are reported to the delegate's -netServiceBrowser:didFindDomain:moreComing: method. There may be more than one registration domain.
 | 
			
		||||
*/
 | 
			
		||||
- (void)searchForRegistrationDomains;
 | 
			
		||||
 | 
			
		||||
/* Starts a search for services of the specified type in the domain indicated by domainString. For each service discovered, a -netServiceBrowser:foundService:moreComing: message is sent to the NSNetServiceBrowser instance's delegate.
 | 
			
		||||
*/
 | 
			
		||||
- (void)searchForServicesOfType:(NSString *)type inDomain:(NSString *)domainString;
 | 
			
		||||
 | 
			
		||||
/* Stops the currently running search.
 | 
			
		||||
*/
 | 
			
		||||
- (void)stop;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.2), ios(2.0), tvos(9.0)) API_UNAVAILABLE(watchos)
 | 
			
		||||
@protocol NSNetServiceDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetService instance's delegate prior to advertising the service on the network. If for some reason the service cannot be published, the delegate will not receive this message, and an error will be delivered to the delegate via the delegate's -netService:didNotPublish: method.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceWillPublish:(NSNetService *)sender;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetService instance's delegate when the publication of the instance is complete and successful.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceDidPublish:(NSNetService *)sender;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetService instance's delegate when an error in publishing the instance occurs. The error dictionary will contain two key/value pairs representing the error domain and code (see the NSNetServicesError enumeration above for error code constants). It is possible for an error to occur after a successful publication.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netService:(NSNetService *)sender didNotPublish:(NSDictionary<NSString *, NSNumber *> *)errorDict;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetService instance's delegate prior to resolving a service on the network. If for some reason the resolution cannot occur, the delegate will not receive this message, and an error will be delivered to the delegate via the delegate's -netService:didNotResolve: method.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceWillResolve:(NSNetService *)sender;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetService instance's delegate when one or more addresses have been resolved for an NSNetService instance. Some NSNetService methods will return different results before and after a successful resolution. An NSNetService instance may get resolved more than once; truly robust clients may wish to resolve again after an error, or to resolve more than once.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceDidResolveAddress:(NSNetService *)sender;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetService instance's delegate when an error in resolving the instance occurs. The error dictionary will contain two key/value pairs representing the error domain and code (see the NSNetServicesError enumeration above for error code constants).
 | 
			
		||||
*/
 | 
			
		||||
- (void)netService:(NSNetService *)sender didNotResolve:(NSDictionary<NSString *, NSNumber *> *)errorDict;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetService instance's delegate when the instance's previously running publication or resolution request has stopped.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceDidStop:(NSNetService *)sender;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetService instance's delegate when the instance is being monitored and the instance's TXT record has been updated. The new record is contained in the data parameter.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netService:(NSNetService *)sender didUpdateTXTRecordData:(NSData *)data;
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
/* Sent to a published NSNetService instance's delegate when a new connection is
 | 
			
		||||
 * received. Before you can communicate with the connecting client, you must -open
 | 
			
		||||
 * and schedule the streams. To reject a connection, just -open both streams and
 | 
			
		||||
 * then immediately -close them.
 | 
			
		||||
 
 | 
			
		||||
 * To enable TLS on the stream, set the various TLS settings using
 | 
			
		||||
 * kCFStreamPropertySSLSettings before calling -open. You must also specify
 | 
			
		||||
 * kCFBooleanTrue for kCFStreamSSLIsServer in the settings dictionary along with
 | 
			
		||||
 * a valid SecIdentityRef as the first entry of kCFStreamSSLCertificates.
 | 
			
		||||
 */
 | 
			
		||||
- (void)netService:(NSNetService *)sender didAcceptConnectionWithInputStream:(NSInputStream *)inputStream outputStream:(NSOutputStream *)outputStream API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.2), ios(2.0), tvos(9.0)) API_UNAVAILABLE(watchos)
 | 
			
		||||
@protocol NSNetServiceBrowserDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetServiceBrowser instance's delegate before the instance begins a search. The delegate will not receive this message if the instance is unable to begin a search. Instead, the delegate will receive the -netServiceBrowser:didNotSearch: message.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceBrowserWillSearch:(NSNetServiceBrowser *)browser;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetServiceBrowser instance's delegate when the instance's previous running search request has stopped.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceBrowserDidStopSearch:(NSNetServiceBrowser *)browser;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetServiceBrowser instance's delegate when an error in searching for domains or services has occurred. The error dictionary will contain two key/value pairs representing the error domain and code (see the NSNetServicesError enumeration above for error code constants). It is possible for an error to occur after a search has been started successfully.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceBrowser:(NSNetServiceBrowser *)browser didNotSearch:(NSDictionary<NSString *, NSNumber *> *)errorDict;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetServiceBrowser instance's delegate for each domain discovered. If there are more domains, moreComing will be YES. If for some reason handling discovered domains requires significant processing, accumulating domains until moreComing is NO and then doing the processing in bulk fashion may be desirable.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceBrowser:(NSNetServiceBrowser *)browser didFindDomain:(NSString *)domainString moreComing:(BOOL)moreComing;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetServiceBrowser instance's delegate for each service discovered. If there are more services, moreComing will be YES. If for some reason handling discovered services requires significant processing, accumulating services until moreComing is NO and then doing the processing in bulk fashion may be desirable.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceBrowser:(NSNetServiceBrowser *)browser didFindService:(NSNetService *)service moreComing:(BOOL)moreComing;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetServiceBrowser instance's delegate when a previously discovered domain is no longer available.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceBrowser:(NSNetServiceBrowser *)browser didRemoveDomain:(NSString *)domainString moreComing:(BOOL)moreComing;
 | 
			
		||||
 | 
			
		||||
/* Sent to the NSNetServiceBrowser instance's delegate when a previously discovered service is no longer published.
 | 
			
		||||
*/
 | 
			
		||||
- (void)netServiceBrowser:(NSNetServiceBrowser *)browser didRemoveService:(NSNetService *)service moreComing:(BOOL)moreComing;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,61 @@
 | 
			
		||||
/*	NSNotification.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
typedef NSString *NSNotificationName NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
@class NSString, NSDictionary, NSOperationQueue;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/****************	Notifications	****************/
 | 
			
		||||
 | 
			
		||||
@interface NSNotification : NSObject <NSCopying, NSCoding>
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSNotificationName name;
 | 
			
		||||
@property (nullable, readonly, retain) id object;
 | 
			
		||||
@property (nullable, readonly, copy) NSDictionary *userInfo;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithName:(NSNotificationName)name object:(nullable id)object userInfo:(nullable NSDictionary *)userInfo API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSNotification (NSNotificationCreation)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)notificationWithName:(NSNotificationName)aName object:(nullable id)anObject;
 | 
			
		||||
+ (instancetype)notificationWithName:(NSNotificationName)aName object:(nullable id)anObject userInfo:(nullable NSDictionary *)aUserInfo;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init /*API_UNAVAILABLE(macos, ios, watchos, tvos)*/;	/* do not invoke; not a valid initializer for this class */
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/****************	Notification Center	****************/
 | 
			
		||||
 | 
			
		||||
@interface NSNotificationCenter : NSObject {
 | 
			
		||||
    @package
 | 
			
		||||
    void *_impl;
 | 
			
		||||
    void *_callback;
 | 
			
		||||
    void *_pad[11];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSNotificationCenter *defaultCenter;
 | 
			
		||||
 | 
			
		||||
- (void)addObserver:(id)observer selector:(SEL)aSelector name:(nullable NSNotificationName)aName object:(nullable id)anObject;
 | 
			
		||||
 | 
			
		||||
- (void)postNotification:(NSNotification *)notification;
 | 
			
		||||
- (void)postNotificationName:(NSNotificationName)aName object:(nullable id)anObject;
 | 
			
		||||
- (void)postNotificationName:(NSNotificationName)aName object:(nullable id)anObject userInfo:(nullable NSDictionary *)aUserInfo;
 | 
			
		||||
 | 
			
		||||
- (void)removeObserver:(id)observer;
 | 
			
		||||
- (void)removeObserver:(id)observer name:(nullable NSNotificationName)aName object:(nullable id)anObject;
 | 
			
		||||
 | 
			
		||||
- (id <NSObject>)addObserverForName:(nullable NSNotificationName)name object:(nullable id)obj queue:(nullable NSOperationQueue *)queue usingBlock:(void (^)(NSNotification *note))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
    // The return value is retained by the system, and should be held onto by the caller in
 | 
			
		||||
    // order to remove the observer with removeObserver: later, to stop observation.
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,43 @@
 | 
			
		||||
/*	NSNotificationQueue.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSRunLoop.h>
 | 
			
		||||
 | 
			
		||||
@class NSNotification, NSNotificationCenter, NSArray<ObjectType>, NSString;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSPostingStyle) {
 | 
			
		||||
    NSPostWhenIdle = 1,
 | 
			
		||||
    NSPostASAP = 2,
 | 
			
		||||
    NSPostNow = 3
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSNotificationCoalescing) {
 | 
			
		||||
    NSNotificationNoCoalescing = 0,
 | 
			
		||||
    NSNotificationCoalescingOnName = 1,
 | 
			
		||||
    NSNotificationCoalescingOnSender = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@interface NSNotificationQueue : NSObject {
 | 
			
		||||
@private
 | 
			
		||||
    id		_notificationCenter;
 | 
			
		||||
    id		_asapQueue;
 | 
			
		||||
    id		_asapObs;
 | 
			
		||||
    id		_idleQueue;
 | 
			
		||||
    id		_idleObs;
 | 
			
		||||
}
 | 
			
		||||
@property (class, readonly, strong) NSNotificationQueue *defaultQueue;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithNotificationCenter:(NSNotificationCenter *)notificationCenter NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (void)enqueueNotification:(NSNotification *)notification postingStyle:(NSPostingStyle)postingStyle;
 | 
			
		||||
- (void)enqueueNotification:(NSNotification *)notification postingStyle:(NSPostingStyle)postingStyle coalesceMask:(NSNotificationCoalescing)coalesceMask forModes:(nullable NSArray<NSRunLoopMode> *)modes;
 | 
			
		||||
 | 
			
		||||
- (void)dequeueNotificationsMatching:(NSNotification *)notification coalesceMask:(NSUInteger)coalesceMask;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,15 @@
 | 
			
		||||
/*	NSNull.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSNull : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
+ (NSNull *)null;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,169 @@
 | 
			
		||||
/*	NSNumberFormatter.h
 | 
			
		||||
	Copyright (c) 1996-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSFormatter.h>
 | 
			
		||||
#include <CoreFoundation/CFNumberFormatter.h>
 | 
			
		||||
 | 
			
		||||
@class NSLocale, NSError, NSMutableDictionary, NSRecursiveLock, NSString, NSCache;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSNumberFormatterBehavior) {
 | 
			
		||||
    NSNumberFormatterBehaviorDefault = 0,
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
    NSNumberFormatterBehavior10_0 = 1000,
 | 
			
		||||
#endif
 | 
			
		||||
    NSNumberFormatterBehavior10_4 = 1040,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@interface NSNumberFormatter : NSFormatter {
 | 
			
		||||
@private
 | 
			
		||||
    NSMutableDictionary	*_attributes;
 | 
			
		||||
    CFNumberFormatterRef _formatter;
 | 
			
		||||
    NSUInteger _counter;
 | 
			
		||||
    NSNumberFormatterBehavior _behavior;
 | 
			
		||||
    NSRecursiveLock *_lock;
 | 
			
		||||
    unsigned long _stateBitMask; // this is for NSUnitFormatter
 | 
			
		||||
    NSInteger _cacheGeneration;
 | 
			
		||||
    void *_reserved[8];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@property NSFormattingContext formattingContext API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)); // default is NSFormattingContextUnknown
 | 
			
		||||
 | 
			
		||||
// - (id)init; // designated initializer
 | 
			
		||||
 | 
			
		||||
// Report the used range of the string and an NSError, in addition to the usual stuff from NSFormatter
 | 
			
		||||
 | 
			
		||||
- (BOOL)getObjectValue:(out id _Nullable * _Nullable)obj forString:(NSString *)string range:(inout nullable NSRange *)rangep error:(out NSError **)error;
 | 
			
		||||
 | 
			
		||||
// Even though NSNumberFormatter responds to the usual NSFormatter methods,
 | 
			
		||||
//   here are some convenience methods which are a little more obvious.
 | 
			
		||||
 | 
			
		||||
- (nullable NSString *)stringFromNumber:(NSNumber *)number;
 | 
			
		||||
- (nullable NSNumber *)numberFromString:(NSString *)string;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSNumberFormatterStyle) {
 | 
			
		||||
    NSNumberFormatterNoStyle = kCFNumberFormatterNoStyle,
 | 
			
		||||
    NSNumberFormatterDecimalStyle = kCFNumberFormatterDecimalStyle,
 | 
			
		||||
    NSNumberFormatterCurrencyStyle = kCFNumberFormatterCurrencyStyle,
 | 
			
		||||
    NSNumberFormatterPercentStyle = kCFNumberFormatterPercentStyle,
 | 
			
		||||
    NSNumberFormatterScientificStyle = kCFNumberFormatterScientificStyle,
 | 
			
		||||
    NSNumberFormatterSpellOutStyle = kCFNumberFormatterSpellOutStyle,
 | 
			
		||||
    NSNumberFormatterOrdinalStyle API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = kCFNumberFormatterOrdinalStyle,
 | 
			
		||||
    NSNumberFormatterCurrencyISOCodeStyle API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = kCFNumberFormatterCurrencyISOCodeStyle,
 | 
			
		||||
    NSNumberFormatterCurrencyPluralStyle API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = kCFNumberFormatterCurrencyPluralStyle,
 | 
			
		||||
    NSNumberFormatterCurrencyAccountingStyle API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)) = kCFNumberFormatterCurrencyAccountingStyle,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
+ (NSString *)localizedStringFromNumber:(NSNumber *)num numberStyle:(NSNumberFormatterStyle)nstyle API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Attributes of an NSNumberFormatter
 | 
			
		||||
 | 
			
		||||
+ (NSNumberFormatterBehavior)defaultFormatterBehavior;
 | 
			
		||||
+ (void)setDefaultFormatterBehavior:(NSNumberFormatterBehavior)behavior;
 | 
			
		||||
 | 
			
		||||
@property NSNumberFormatterStyle numberStyle;
 | 
			
		||||
@property (null_resettable, copy) NSLocale *locale;
 | 
			
		||||
@property BOOL generatesDecimalNumbers;
 | 
			
		||||
@property NSNumberFormatterBehavior formatterBehavior;
 | 
			
		||||
 | 
			
		||||
@property (null_resettable, copy) NSString *negativeFormat;
 | 
			
		||||
@property (nullable, copy) NSDictionary<NSString *, id> *textAttributesForNegativeValues;
 | 
			
		||||
@property (null_resettable, copy) NSString *positiveFormat;
 | 
			
		||||
@property (nullable, copy) NSDictionary<NSString *, id> *textAttributesForPositiveValues;
 | 
			
		||||
@property BOOL allowsFloats;
 | 
			
		||||
@property (null_resettable, copy) NSString *decimalSeparator;
 | 
			
		||||
@property BOOL alwaysShowsDecimalSeparator;
 | 
			
		||||
@property (null_resettable, copy) NSString *currencyDecimalSeparator;
 | 
			
		||||
@property BOOL usesGroupingSeparator;
 | 
			
		||||
@property (null_resettable, copy) NSString *groupingSeparator;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSString *zeroSymbol;
 | 
			
		||||
@property (nullable, copy) NSDictionary<NSString *, id> *textAttributesForZero;
 | 
			
		||||
@property (copy) NSString *nilSymbol;
 | 
			
		||||
@property (nullable, copy) NSDictionary<NSString *, id> *textAttributesForNil;
 | 
			
		||||
@property (null_resettable, copy) NSString *notANumberSymbol;
 | 
			
		||||
@property (nullable, copy) NSDictionary<NSString *, id> *textAttributesForNotANumber;
 | 
			
		||||
@property (copy) NSString *positiveInfinitySymbol;
 | 
			
		||||
@property (nullable, copy) NSDictionary<NSString *, id> *textAttributesForPositiveInfinity;
 | 
			
		||||
@property (copy) NSString *negativeInfinitySymbol;
 | 
			
		||||
@property (nullable, copy) NSDictionary<NSString *, id> *textAttributesForNegativeInfinity;
 | 
			
		||||
 | 
			
		||||
@property (null_resettable, copy) NSString *positivePrefix;
 | 
			
		||||
@property (null_resettable, copy) NSString *positiveSuffix;
 | 
			
		||||
@property (null_resettable, copy) NSString *negativePrefix;
 | 
			
		||||
@property (null_resettable, copy) NSString *negativeSuffix;
 | 
			
		||||
@property (null_resettable, copy) NSString *currencyCode;
 | 
			
		||||
@property (null_resettable, copy) NSString *currencySymbol;
 | 
			
		||||
@property (null_resettable, copy) NSString *internationalCurrencySymbol;
 | 
			
		||||
@property (null_resettable, copy) NSString *percentSymbol;
 | 
			
		||||
@property (null_resettable, copy) NSString *perMillSymbol;
 | 
			
		||||
@property (null_resettable, copy) NSString *minusSign;
 | 
			
		||||
@property (null_resettable, copy) NSString *plusSign;
 | 
			
		||||
@property (null_resettable, copy) NSString *exponentSymbol;
 | 
			
		||||
 | 
			
		||||
@property NSUInteger groupingSize;
 | 
			
		||||
@property NSUInteger secondaryGroupingSize;
 | 
			
		||||
@property (nullable, copy) NSNumber *multiplier;
 | 
			
		||||
@property NSUInteger formatWidth;
 | 
			
		||||
@property (null_resettable, copy) NSString *paddingCharacter;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSNumberFormatterPadPosition) {
 | 
			
		||||
    NSNumberFormatterPadBeforePrefix = kCFNumberFormatterPadBeforePrefix,
 | 
			
		||||
    NSNumberFormatterPadAfterPrefix = kCFNumberFormatterPadAfterPrefix,
 | 
			
		||||
    NSNumberFormatterPadBeforeSuffix = kCFNumberFormatterPadBeforeSuffix,
 | 
			
		||||
    NSNumberFormatterPadAfterSuffix = kCFNumberFormatterPadAfterSuffix
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSNumberFormatterRoundingMode) {
 | 
			
		||||
    NSNumberFormatterRoundCeiling = kCFNumberFormatterRoundCeiling,
 | 
			
		||||
    NSNumberFormatterRoundFloor = kCFNumberFormatterRoundFloor,
 | 
			
		||||
    NSNumberFormatterRoundDown = kCFNumberFormatterRoundDown,
 | 
			
		||||
    NSNumberFormatterRoundUp = kCFNumberFormatterRoundUp,
 | 
			
		||||
    NSNumberFormatterRoundHalfEven = kCFNumberFormatterRoundHalfEven,
 | 
			
		||||
    NSNumberFormatterRoundHalfDown = kCFNumberFormatterRoundHalfDown,
 | 
			
		||||
    NSNumberFormatterRoundHalfUp = kCFNumberFormatterRoundHalfUp
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@property NSNumberFormatterPadPosition paddingPosition;
 | 
			
		||||
@property NSNumberFormatterRoundingMode roundingMode;
 | 
			
		||||
@property (null_resettable, copy) NSNumber *roundingIncrement;
 | 
			
		||||
@property NSUInteger minimumIntegerDigits;
 | 
			
		||||
@property NSUInteger maximumIntegerDigits;
 | 
			
		||||
@property NSUInteger minimumFractionDigits;
 | 
			
		||||
@property NSUInteger maximumFractionDigits;
 | 
			
		||||
@property (nullable, copy) NSNumber *minimum;
 | 
			
		||||
@property (nullable, copy) NSNumber *maximum;
 | 
			
		||||
@property (null_resettable, copy) NSString *currencyGroupingSeparator API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (getter=isLenient) BOOL lenient API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property BOOL usesSignificantDigits API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property NSUInteger minimumSignificantDigits API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property NSUInteger maximumSignificantDigits API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (getter=isPartialStringValidationEnabled) BOOL partialStringValidationEnabled API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@class NSDecimalNumberHandler;
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
@interface NSNumberFormatter (NSNumberFormatterCompatibility)
 | 
			
		||||
 | 
			
		||||
@property BOOL hasThousandSeparators;
 | 
			
		||||
@property (null_resettable, copy) NSString *thousandSeparator;
 | 
			
		||||
 | 
			
		||||
@property BOOL localizesFormat;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSString *format;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSAttributedString *attributedStringForZero;
 | 
			
		||||
@property (copy) NSAttributedString *attributedStringForNil;
 | 
			
		||||
@property (copy) NSAttributedString *attributedStringForNotANumber;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSDecimalNumberHandler *roundingBehavior;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,655 @@
 | 
			
		||||
/*	NSObjCRuntime.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#include <TargetConditionals.h>
 | 
			
		||||
#include <Availability.h>
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX || TARGET_OS_IPHONE
 | 
			
		||||
#include <objc/NSObjCRuntime.h>
 | 
			
		||||
#include <stdarg.h>
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
#include <AvailabilityMacros.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(__cplusplus)
 | 
			
		||||
#define FOUNDATION_EXTERN extern "C"
 | 
			
		||||
#else
 | 
			
		||||
#define FOUNDATION_EXTERN extern
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define FOUNDATION_EXPORT FOUNDATION_EXTERN
 | 
			
		||||
#define FOUNDATION_IMPORT FOUNDATION_EXTERN
 | 
			
		||||
 | 
			
		||||
#if !defined(NS_INLINE)
 | 
			
		||||
    #if defined(__GNUC__)
 | 
			
		||||
        #define NS_INLINE static __inline__ __attribute__((always_inline))
 | 
			
		||||
    #elif defined(__MWERKS__) || defined(__cplusplus)
 | 
			
		||||
        #define NS_INLINE static inline
 | 
			
		||||
    #elif defined(_MSC_VER)
 | 
			
		||||
        #define NS_INLINE static __inline
 | 
			
		||||
    #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(FOUNDATION_STATIC_INLINE)
 | 
			
		||||
#define FOUNDATION_STATIC_INLINE static __inline__
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(FOUNDATION_EXTERN_INLINE)
 | 
			
		||||
#define FOUNDATION_EXTERN_INLINE extern __inline__
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(NS_REQUIRES_NIL_TERMINATION)
 | 
			
		||||
    #if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549)
 | 
			
		||||
        #define NS_REQUIRES_NIL_TERMINATION __attribute__((sentinel(0,1)))
 | 
			
		||||
    #else
 | 
			
		||||
        #define NS_REQUIRES_NIL_TERMINATION __attribute__((sentinel))
 | 
			
		||||
    #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(NS_BLOCKS_AVAILABLE)
 | 
			
		||||
    #if __BLOCKS__ && (MAC_OS_X_VERSION_10_6 <= MAC_OS_X_VERSION_MAX_ALLOWED || __IPHONE_4_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED)
 | 
			
		||||
        #define NS_BLOCKS_AVAILABLE 1
 | 
			
		||||
    #else
 | 
			
		||||
        #define NS_BLOCKS_AVAILABLE 0
 | 
			
		||||
    #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Marks APIs whose iOS versions are nonatomic, that is cannot be set/get from multiple threads safely without additional synchronization
 | 
			
		||||
#if __clang_tapi__
 | 
			
		||||
    #if !defined(NS_NONATOMIC_IOSONLY)
 | 
			
		||||
        #if TARGET_OS_OSX || TARGET_OS_MACCATALYST
 | 
			
		||||
            #if __has_feature(objc_property_explicit_atomic)
 | 
			
		||||
                #define NS_NONATOMIC_IOSONLY atomic
 | 
			
		||||
            #else
 | 
			
		||||
                #define NS_NONATOMIC_IOSONLY
 | 
			
		||||
            #endif
 | 
			
		||||
        #else
 | 
			
		||||
            #define NS_NONATOMIC_IOSONLY nonatomic
 | 
			
		||||
        #endif
 | 
			
		||||
    #endif
 | 
			
		||||
#else
 | 
			
		||||
    #if !defined(NS_NONATOMIC_IOSONLY)
 | 
			
		||||
        #if TARGET_OS_IPHONE
 | 
			
		||||
            #define NS_NONATOMIC_IOSONLY nonatomic
 | 
			
		||||
        #else
 | 
			
		||||
            #if __has_feature(objc_property_explicit_atomic)
 | 
			
		||||
                #define NS_NONATOMIC_IOSONLY atomic
 | 
			
		||||
            #else
 | 
			
		||||
                #define NS_NONATOMIC_IOSONLY
 | 
			
		||||
            #endif
 | 
			
		||||
        #endif
 | 
			
		||||
    #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Use NS_NONATOMIC_IOSONLY instead of this older macro
 | 
			
		||||
#if !defined(NS_NONATOMIC_IPHONEONLY)
 | 
			
		||||
#define NS_NONATOMIC_IPHONEONLY NS_NONATOMIC_IOSONLY
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Marks APIs which format strings by taking a format string and optional varargs as arguments
 | 
			
		||||
#if !defined(NS_FORMAT_FUNCTION)
 | 
			
		||||
    #if (__GNUC__*10+__GNUC_MINOR__ >= 42)
 | 
			
		||||
	#define NS_FORMAT_FUNCTION(F,A) __attribute__((format(__NSString__, F, A)))
 | 
			
		||||
    #else
 | 
			
		||||
	#define NS_FORMAT_FUNCTION(F,A)
 | 
			
		||||
    #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Marks APIs which are often used to process (take and return) format strings, so they can be used in place of a constant format string parameter in APIs
 | 
			
		||||
#if !defined(NS_FORMAT_ARGUMENT)
 | 
			
		||||
    #if defined(__clang__)
 | 
			
		||||
	#define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
 | 
			
		||||
    #else
 | 
			
		||||
	#define NS_FORMAT_ARGUMENT(A)
 | 
			
		||||
    #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Some compilers provide the capability to test if certain features are available. This macro provides a compatibility path for other compilers.
 | 
			
		||||
#ifndef __has_feature
 | 
			
		||||
#define __has_feature(x) 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef __has_extension
 | 
			
		||||
#define __has_extension(x) 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Some compilers provide the capability to test if certain attributes are available. This macro provides a compatibility path for other compilers.
 | 
			
		||||
#ifndef __has_attribute
 | 
			
		||||
#define __has_attribute(x) 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Marks methods and functions which return an object that needs to be released by the caller but whose names are not consistent with Cocoa naming rules. The recommended fix to this is to rename the methods or functions, but this macro can be used to let the clang static analyzer know of any exceptions that cannot be fixed.
 | 
			
		||||
// This macro is ONLY to be used in exceptional circumstances, not to annotate functions which conform to the Cocoa naming rules.
 | 
			
		||||
#if __has_feature(attribute_ns_returns_retained)
 | 
			
		||||
#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_RETURNS_RETAINED
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Marks methods and functions which return an object that may need to be retained by the caller but whose names are not consistent with Cocoa naming rules. The recommended fix to this is to rename the methods or functions, but this macro can be used to let the clang static analyzer know of any exceptions that cannot be fixed.
 | 
			
		||||
// This macro is ONLY to be used in exceptional circumstances, not to annotate functions which conform to the Cocoa naming rules.
 | 
			
		||||
#if __has_feature(attribute_ns_returns_not_retained)
 | 
			
		||||
#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_RETURNS_NOT_RETAINED
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NS_RETURNS_INNER_POINTER
 | 
			
		||||
#if __has_attribute(objc_returns_inner_pointer)
 | 
			
		||||
#define NS_RETURNS_INNER_POINTER __attribute__((objc_returns_inner_pointer))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_RETURNS_INNER_POINTER
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Marks methods and functions which cannot be used when compiling in automatic reference counting mode.
 | 
			
		||||
#if __has_feature(objc_arc)
 | 
			
		||||
#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Marks classes which cannot participate in the ARC weak reference feature.
 | 
			
		||||
#if __has_attribute(objc_arc_weak_reference_unavailable)
 | 
			
		||||
#define NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE __attribute__((objc_arc_weak_reference_unavailable))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Marks classes that must specify @dynamic or @synthesize for properties in their @implementation (property getters & setters will not be synthesized unless the @synthesize directive is used)
 | 
			
		||||
#if __has_attribute(objc_requires_property_definitions)
 | 
			
		||||
#define NS_REQUIRES_PROPERTY_DEFINITIONS __attribute__((objc_requires_property_definitions)) 
 | 
			
		||||
#else
 | 
			
		||||
#define NS_REQUIRES_PROPERTY_DEFINITIONS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Decorates methods in which the receiver may be replaced with the result of the method. 
 | 
			
		||||
#if __has_feature(attribute_ns_consumes_self)
 | 
			
		||||
#define NS_REPLACES_RECEIVER __attribute__((ns_consumes_self)) NS_RETURNS_RETAINED
 | 
			
		||||
#else
 | 
			
		||||
#define NS_REPLACES_RECEIVER
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if __has_feature(attribute_ns_consumed)
 | 
			
		||||
#define NS_RELEASES_ARGUMENT __attribute__((ns_consumed))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_RELEASES_ARGUMENT
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Mark local variables of type 'id' or pointer-to-ObjC-object-type so that values stored into that local variable are not aggressively released by the compiler during optimization, but are held until either the variable is assigned to again, or the end of the scope (such as a compound statement, or method definition) of the local variable.
 | 
			
		||||
#ifndef NS_VALID_UNTIL_END_OF_SCOPE
 | 
			
		||||
#if __has_attribute(objc_precise_lifetime)
 | 
			
		||||
#define NS_VALID_UNTIL_END_OF_SCOPE __attribute__((objc_precise_lifetime))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_VALID_UNTIL_END_OF_SCOPE
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Annotate classes which are root classes as really being root classes
 | 
			
		||||
#ifndef NS_ROOT_CLASS
 | 
			
		||||
#if __has_attribute(objc_root_class)
 | 
			
		||||
#define NS_ROOT_CLASS __attribute__((objc_root_class))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_ROOT_CLASS
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NS_REQUIRES_SUPER
 | 
			
		||||
#if __has_attribute(objc_requires_super)
 | 
			
		||||
#define NS_REQUIRES_SUPER __attribute__((objc_requires_super))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_REQUIRES_SUPER
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NS_DESIGNATED_INITIALIZER
 | 
			
		||||
#if __has_attribute(objc_designated_initializer)
 | 
			
		||||
#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_DESIGNATED_INITIALIZER
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
#if __has_attribute(objc_protocol_requires_explicit_implementation)
 | 
			
		||||
#define NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION __attribute__((objc_protocol_requires_explicit_implementation))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if __has_attribute(not_tail_called)
 | 
			
		||||
#define NS_NO_TAIL_CALL __attribute__((not_tail_called))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_NO_TAIL_CALL
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !__has_feature(objc_instancetype)
 | 
			
		||||
#undef instancetype
 | 
			
		||||
#define instancetype id
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if __has_attribute(swift_async)
 | 
			
		||||
#  define NS_SWIFT_DISABLE_ASYNC __attribute__((swift_async(none)))
 | 
			
		||||
#  define NS_SWIFT_ASYNC(COMPLETION_BLOCK_INDEX) __attribute__((swift_async(not_swift_private, COMPLETION_BLOCK_INDEX)))
 | 
			
		||||
#  define NS_REFINED_FOR_SWIFT_ASYNC(COMPLETION_BLOCK_INDEX) __attribute__((swift_async(swift_private, COMPLETION_BLOCK_INDEX)))
 | 
			
		||||
#else
 | 
			
		||||
#  define NS_SWIFT_DISABLE_ASYNC
 | 
			
		||||
#  define NS_SWIFT_ASYNC(COMPLETION_BLOCK_INDEX)
 | 
			
		||||
#  define NS_REFINED_FOR_SWIFT_ASYNC(COMPLETION_BLOCK_INDEX)
 | 
			
		||||
#endif
 | 
			
		||||
#if __has_attribute(swift_async_name)
 | 
			
		||||
#  define NS_SWIFT_ASYNC_NAME(NAME) __attribute__((swift_async_name(#NAME)))
 | 
			
		||||
#else
 | 
			
		||||
#  define NS_SWIFT_ASYNC_NAME(NAME)
 | 
			
		||||
#endif
 | 
			
		||||
#if __has_attribute(swift_attr)
 | 
			
		||||
#  define NS_SWIFT_UI_ACTOR __attribute__((swift_attr("@UIActor")))
 | 
			
		||||
#else
 | 
			
		||||
#  define NS_SWIFT_UI_ACTOR
 | 
			
		||||
#endif
 | 
			
		||||
#if __has_attribute(swift_async_error)
 | 
			
		||||
#  define NS_SWIFT_ASYNC_NOTHROW __attribute__((swift_async_error(none)))
 | 
			
		||||
#  define NS_SWIFT_ASYNC_THROWS_ON_TRUE(TRUE_PARAMETER_INDEX) __attribute__((swift_async_error(nonzero_argument, TRUE_PARAMETER_INDEX)))
 | 
			
		||||
#  define NS_SWIFT_ASYNC_THROWS_ON_FALSE(FALSE_PARAMETER_INDEX)  __attribute__((swift_async_error(zero_argument, FALSE_PARAMETER_INDEX)))
 | 
			
		||||
#else
 | 
			
		||||
#  define NS_SWIFT_ASYNC_NOTHROW
 | 
			
		||||
#  define NS_SWIFT_ASYNC_THROWS_ON_TRUE(TRUE_PARAMETER_INDEX)
 | 
			
		||||
#  define NS_SWIFT_ASYNC_THROWS_ON_FALSE(FALSE_PARAMETER_INDEX)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(NS_UNAVAILABLE)
 | 
			
		||||
#define NS_UNAVAILABLE UNAVAILABLE_ATTRIBUTE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(__unsafe_unretained)
 | 
			
		||||
#define __unsafe_unretained
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <CoreFoundation/CFAvailability.h>
 | 
			
		||||
 | 
			
		||||
#define NS_AVAILABLE(_mac, _ios) CF_AVAILABLE(_mac, _ios)
 | 
			
		||||
#define NS_AVAILABLE_MAC(_mac) CF_AVAILABLE_MAC(_mac)
 | 
			
		||||
#define NS_AVAILABLE_IOS(_ios) CF_AVAILABLE_IOS(_ios)
 | 
			
		||||
 | 
			
		||||
#define NS_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) CF_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, __VA_ARGS__)
 | 
			
		||||
#define NS_DEPRECATED_MAC(_macIntro, _macDep, ...) CF_DEPRECATED_MAC(_macIntro, _macDep, __VA_ARGS__)
 | 
			
		||||
#define NS_DEPRECATED_IOS(_iosIntro, _iosDep, ...) CF_DEPRECATED_IOS(_iosIntro, _iosDep, __VA_ARGS__)
 | 
			
		||||
 | 
			
		||||
#define NS_DEPRECATED_WITH_REPLACEMENT_MAC(_rep, _macIntroduced, _macDeprecated) API_DEPRECATED_WITH_REPLACEMENT(_rep, macosx(_macIntroduced, _macDeprecated)) API_UNAVAILABLE(ios, watchos, tvos)
 | 
			
		||||
 | 
			
		||||
#define NS_ENUM_AVAILABLE(_mac, _ios) CF_ENUM_AVAILABLE(_mac, _ios)
 | 
			
		||||
#define NS_ENUM_AVAILABLE_MAC(_mac) CF_ENUM_AVAILABLE_MAC(_mac)
 | 
			
		||||
#define NS_ENUM_AVAILABLE_IOS(_ios) CF_ENUM_AVAILABLE_IOS(_ios)
 | 
			
		||||
 | 
			
		||||
#define NS_ENUM_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) CF_ENUM_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, __VA_ARGS__)
 | 
			
		||||
#define NS_ENUM_DEPRECATED_MAC(_macIntro, _macDep, ...) CF_ENUM_DEPRECATED_MAC(_macIntro, _macDep, __VA_ARGS__)
 | 
			
		||||
#define NS_ENUM_DEPRECATED_IOS(_iosIntro, _iosDep, ...) CF_ENUM_DEPRECATED_IOS(_iosIntro, _iosDep, __VA_ARGS__)
 | 
			
		||||
 | 
			
		||||
#define NS_AVAILABLE_IPHONE(_ios) CF_AVAILABLE_IOS(_ios)
 | 
			
		||||
#define NS_DEPRECATED_IPHONE(_iosIntro, _iosDep) CF_DEPRECATED_IOS(_iosIntro, _iosDep)
 | 
			
		||||
 | 
			
		||||
/* NS_ENUM supports the use of one or two arguments. The first argument is always the integer type used for the values of the enum. The second argument is an optional type name for the macro. When specifying a type name, you must precede the macro with 'typedef' like so:
 | 
			
		||||
 
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSComparisonResult) {
 | 
			
		||||
    ...
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
If you do not specify a type name, do not use 'typedef'. For example:
 | 
			
		||||
 
 | 
			
		||||
NS_ENUM(NSInteger) {
 | 
			
		||||
    ...
 | 
			
		||||
};
 | 
			
		||||
*/
 | 
			
		||||
#define NS_ENUM(...) CF_ENUM(__VA_ARGS__)
 | 
			
		||||
#define NS_OPTIONS(_type, _name) CF_OPTIONS(_type, _name)
 | 
			
		||||
 | 
			
		||||
/* NS_CLOSED_ENUM is only for enums which are guaranteed to never gain an additional case.
 | 
			
		||||
 
 | 
			
		||||
Usually, this is because the enum represents a mathematically complete set. For example: NSComparisonResult. Once an enum is marked as closed, it is a binary and source incompatible change to add a new value. If there is any doubt about an enum gaining a private or additional public case in the future, use NS_ENUM instead.
 | 
			
		||||
*/
 | 
			
		||||
#define NS_CLOSED_ENUM(_type, _name) CF_CLOSED_ENUM(_type, _name)
 | 
			
		||||
 | 
			
		||||
/* */
 | 
			
		||||
 | 
			
		||||
#define _NS_TYPED_ENUM _CF_TYPED_ENUM
 | 
			
		||||
#define _NS_TYPED_EXTENSIBLE_ENUM _CF_TYPED_EXTENSIBLE_ENUM
 | 
			
		||||
 | 
			
		||||
// Note: NS_TYPED_ENUM is preferred to NS_STRING_ENUM
 | 
			
		||||
#define NS_STRING_ENUM _NS_TYPED_ENUM
 | 
			
		||||
// Note: NS_TYPED_EXTENSIBLE_ENUM is preferred to NS_EXTENSIBLE_STRING_ENUM
 | 
			
		||||
#define NS_EXTENSIBLE_STRING_ENUM _NS_TYPED_EXTENSIBLE_ENUM
 | 
			
		||||
 | 
			
		||||
#define NS_TYPED_ENUM _NS_TYPED_ENUM
 | 
			
		||||
#define NS_TYPED_EXTENSIBLE_ENUM _NS_TYPED_EXTENSIBLE_ENUM
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define __NS_ERROR_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
 | 
			
		||||
#if ((__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum))) && __has_attribute(ns_error_domain)
 | 
			
		||||
#define __NS_NAMED_ERROR_ENUM(_domain, _name)     enum _name : NSInteger _name; enum __attribute__((ns_error_domain(_domain))) _name : NSInteger
 | 
			
		||||
#define __NS_ANON_ERROR_ENUM(_domain)             enum __attribute__((ns_error_domain(_domain))) : NSInteger
 | 
			
		||||
#else
 | 
			
		||||
#define __NS_NAMED_ERROR_ENUM(_domain, _name) NS_ENUM(NSInteger, _name)
 | 
			
		||||
#define __NS_ANON_ERROR_ENUM(_domain) NS_ENUM(NSInteger)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* NS_ERROR_ENUM supports the use of one or two arguments. The first argument is always the domain specifier for the enum. The second argument is an optional name of the typedef for the macro. When specifying a name for of the typedef, you must precede the macro with 'typedef' like so:
 | 
			
		||||
 
 | 
			
		||||
 typedef NS_ERROR_ENUM(MyErrorDomain, SomeErrorCodes) {
 | 
			
		||||
 ...
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
 If you do not specify a typedef name, do not use 'typedef', like so:
 | 
			
		||||
 
 | 
			
		||||
 NS_ERROR_ENUM(MyErrorDomain) {
 | 
			
		||||
 ...
 | 
			
		||||
 };
 | 
			
		||||
 */
 | 
			
		||||
#define NS_ERROR_ENUM(...) __NS_ERROR_ENUM_GET_MACRO(__VA_ARGS__, __NS_NAMED_ERROR_ENUM, __NS_ANON_ERROR_ENUM)(__VA_ARGS__)
 | 
			
		||||
 | 
			
		||||
#define NS_SWIFT_BRIDGED_TYPEDEF CF_SWIFT_BRIDGED_TYPEDEF
 | 
			
		||||
 | 
			
		||||
// This macro is to be used by system frameworks to support the weak linking of classes. Weak linking is supported on iOS 3.1 and Mac OS X 10.6.8 or later.
 | 
			
		||||
#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_1) && \
 | 
			
		||||
    ((__has_feature(objc_weak_class) || \
 | 
			
		||||
     (defined(__llvm__) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5658)) || \
 | 
			
		||||
     (defined(__APPLE_CC__) && (__APPLE_CC__ >= 5666))))
 | 
			
		||||
#define NS_CLASS_AVAILABLE(_mac, _ios) __attribute__((visibility("default"))) NS_AVAILABLE(_mac, _ios)
 | 
			
		||||
#define NS_CLASS_DEPRECATED(_mac, _macDep, _ios, _iosDep, ...) __attribute__((visibility("default"))) NS_DEPRECATED(_mac, _macDep, _ios, _iosDep, __VA_ARGS__)
 | 
			
		||||
#else
 | 
			
		||||
// class weak import is not supported
 | 
			
		||||
#define NS_CLASS_AVAILABLE(_mac, _ios)
 | 
			
		||||
#define NS_CLASS_DEPRECATED(_mac, _macDep, _ios, _iosDep, ...)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define NS_CLASS_AVAILABLE_IOS(_ios) NS_CLASS_AVAILABLE(NA, _ios)
 | 
			
		||||
#define NS_CLASS_AVAILABLE_MAC(_mac) NS_CLASS_AVAILABLE(_mac, NA)
 | 
			
		||||
#define NS_CLASS_DEPRECATED_MAC(_macIntro, _macDep, ...) NS_CLASS_DEPRECATED(_macIntro, _macDep, NA, NA, __VA_ARGS__)
 | 
			
		||||
#define NS_CLASS_DEPRECATED_IOS(_iosIntro, _iosDep, ...) NS_CLASS_DEPRECATED(NA, NA, _iosIntro, _iosDep, __VA_ARGS__)
 | 
			
		||||
 | 
			
		||||
#define NS_EXTENSION_UNAVAILABLE(_msg)      __OS_EXTENSION_UNAVAILABLE(_msg)
 | 
			
		||||
#define NS_EXTENSION_UNAVAILABLE_MAC(_msg)  __OSX_EXTENSION_UNAVAILABLE(_msg)
 | 
			
		||||
#define NS_EXTENSION_UNAVAILABLE_IOS(_msg)  __IOS_EXTENSION_UNAVAILABLE(_msg)
 | 
			
		||||
 | 
			
		||||
#define NS_SWIFT_UNAVAILABLE(_msg) CF_SWIFT_UNAVAILABLE(_msg)
 | 
			
		||||
 | 
			
		||||
#ifndef NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
#define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef NS_ASSUME_NONNULL_END
 | 
			
		||||
#define NS_ASSUME_NONNULL_END   _Pragma("clang assume_nonnull end")
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define NS_REFINED_FOR_SWIFT CF_REFINED_FOR_SWIFT
 | 
			
		||||
 | 
			
		||||
#define NS_SWIFT_NAME(_name) CF_SWIFT_NAME(_name)
 | 
			
		||||
 | 
			
		||||
#define NS_NOESCAPE CF_NOESCAPE
 | 
			
		||||
 | 
			
		||||
#if __has_attribute(swift_error)
 | 
			
		||||
#define NS_SWIFT_NOTHROW __attribute__((swift_error(none)))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_SWIFT_NOTHROW
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define NS_WARN_UNUSED_RESULT CF_WARN_UNUSED_RESULT
 | 
			
		||||
 | 
			
		||||
// There is no need to use this macro any longer, the last Foundation epoch 
 | 
			
		||||
// was 8 and that is now assumed to be the final version. 
 | 
			
		||||
#define FOUNDATION_SWIFT_SDK_EPOCH_AT_LEAST(__epoch__) (!defined(SWIFT_CLASS_EXTRA))
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT double NSFoundationVersionNumber;
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_MAC
 | 
			
		||||
#define NSFoundationVersionNumber10_0	397.40
 | 
			
		||||
#define NSFoundationVersionNumber10_1	425.00
 | 
			
		||||
#define NSFoundationVersionNumber10_1_1	425.00
 | 
			
		||||
#define NSFoundationVersionNumber10_1_2	425.00
 | 
			
		||||
#define NSFoundationVersionNumber10_1_3	425.00
 | 
			
		||||
#define NSFoundationVersionNumber10_1_4	425.00
 | 
			
		||||
#define NSFoundationVersionNumber10_2	462.00
 | 
			
		||||
#define NSFoundationVersionNumber10_2_1	462.00
 | 
			
		||||
#define NSFoundationVersionNumber10_2_2	462.00
 | 
			
		||||
#define NSFoundationVersionNumber10_2_3	462.00
 | 
			
		||||
#define NSFoundationVersionNumber10_2_4	462.00
 | 
			
		||||
#define NSFoundationVersionNumber10_2_5	462.00
 | 
			
		||||
#define NSFoundationVersionNumber10_2_6	462.00
 | 
			
		||||
#define NSFoundationVersionNumber10_2_7	462.70
 | 
			
		||||
#define NSFoundationVersionNumber10_2_8	462.70
 | 
			
		||||
#define NSFoundationVersionNumber10_3	500.00
 | 
			
		||||
#define NSFoundationVersionNumber10_3_1	500.00
 | 
			
		||||
#define NSFoundationVersionNumber10_3_2	500.30
 | 
			
		||||
#define NSFoundationVersionNumber10_3_3	500.54
 | 
			
		||||
#define NSFoundationVersionNumber10_3_4	500.56
 | 
			
		||||
#define NSFoundationVersionNumber10_3_5	500.56
 | 
			
		||||
#define NSFoundationVersionNumber10_3_6	500.56
 | 
			
		||||
#define NSFoundationVersionNumber10_3_7	500.56
 | 
			
		||||
#define NSFoundationVersionNumber10_3_8	500.56
 | 
			
		||||
#define NSFoundationVersionNumber10_3_9	500.58
 | 
			
		||||
#define NSFoundationVersionNumber10_4	567.00
 | 
			
		||||
#define NSFoundationVersionNumber10_4_1	567.00
 | 
			
		||||
#define NSFoundationVersionNumber10_4_2	567.12
 | 
			
		||||
#define NSFoundationVersionNumber10_4_3	567.21
 | 
			
		||||
#define NSFoundationVersionNumber10_4_4_Intel	567.23
 | 
			
		||||
#define NSFoundationVersionNumber10_4_4_PowerPC	567.21
 | 
			
		||||
#define NSFoundationVersionNumber10_4_5	567.25
 | 
			
		||||
#define NSFoundationVersionNumber10_4_6	567.26
 | 
			
		||||
#define NSFoundationVersionNumber10_4_7	567.27
 | 
			
		||||
#define NSFoundationVersionNumber10_4_8	567.28
 | 
			
		||||
#define NSFoundationVersionNumber10_4_9	567.29
 | 
			
		||||
#define NSFoundationVersionNumber10_4_10	567.29
 | 
			
		||||
#define NSFoundationVersionNumber10_4_11	567.36
 | 
			
		||||
#define NSFoundationVersionNumber10_5	677.00
 | 
			
		||||
#define NSFoundationVersionNumber10_5_1	677.10
 | 
			
		||||
#define NSFoundationVersionNumber10_5_2 677.15
 | 
			
		||||
#define NSFoundationVersionNumber10_5_3 677.19
 | 
			
		||||
#define NSFoundationVersionNumber10_5_4 677.19
 | 
			
		||||
#define NSFoundationVersionNumber10_5_5 677.21
 | 
			
		||||
#define NSFoundationVersionNumber10_5_6 677.22
 | 
			
		||||
#define NSFoundationVersionNumber10_5_7 677.24
 | 
			
		||||
#define NSFoundationVersionNumber10_5_8 677.26
 | 
			
		||||
#define NSFoundationVersionNumber10_6 751.00
 | 
			
		||||
#define NSFoundationVersionNumber10_6_1 751.00
 | 
			
		||||
#define NSFoundationVersionNumber10_6_2 751.14
 | 
			
		||||
#define NSFoundationVersionNumber10_6_3 751.21
 | 
			
		||||
#define NSFoundationVersionNumber10_6_4 751.29
 | 
			
		||||
#define NSFoundationVersionNumber10_6_5 751.42
 | 
			
		||||
#define NSFoundationVersionNumber10_6_6 751.53
 | 
			
		||||
#define NSFoundationVersionNumber10_6_7 751.53
 | 
			
		||||
#define NSFoundationVersionNumber10_6_8 751.62
 | 
			
		||||
#define NSFoundationVersionNumber10_7 833.10
 | 
			
		||||
#define NSFoundationVersionNumber10_7_1 833.10
 | 
			
		||||
#define NSFoundationVersionNumber10_7_2 833.20
 | 
			
		||||
#define NSFoundationVersionNumber10_7_3 833.24
 | 
			
		||||
#define NSFoundationVersionNumber10_7_4 833.25
 | 
			
		||||
#define NSFoundationVersionNumber10_8 945.00
 | 
			
		||||
#define NSFoundationVersionNumber10_8_1 945.00
 | 
			
		||||
#define NSFoundationVersionNumber10_8_2 945.11
 | 
			
		||||
#define NSFoundationVersionNumber10_8_3 945.16
 | 
			
		||||
#define NSFoundationVersionNumber10_8_4 945.18
 | 
			
		||||
#define NSFoundationVersionNumber10_9 1056
 | 
			
		||||
#define NSFoundationVersionNumber10_9_1 1056
 | 
			
		||||
#define NSFoundationVersionNumber10_9_2 1056.13
 | 
			
		||||
#define NSFoundationVersionNumber10_10 1151.16
 | 
			
		||||
#define NSFoundationVersionNumber10_10_1 1151.16
 | 
			
		||||
#define NSFoundationVersionNumber10_10_2 1152.14
 | 
			
		||||
#define NSFoundationVersionNumber10_10_3 1153.20
 | 
			
		||||
#define NSFoundationVersionNumber10_10_4 1153.20
 | 
			
		||||
#define NSFoundationVersionNumber10_10_5 1154
 | 
			
		||||
#define NSFoundationVersionNumber10_10_Max 1199
 | 
			
		||||
#define NSFoundationVersionNumber10_11   1252
 | 
			
		||||
#define NSFoundationVersionNumber10_11_1 1255.1
 | 
			
		||||
#define NSFoundationVersionNumber10_11_2 1256.1
 | 
			
		||||
#define NSFoundationVersionNumber10_11_3 1256.1
 | 
			
		||||
#define NSFoundationVersionNumber10_11_4 1258
 | 
			
		||||
#define NSFoundationVersionNumber10_11_Max 1299
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_IPHONE
 | 
			
		||||
#define NSFoundationVersionNumber_iPhoneOS_2_0	678.24
 | 
			
		||||
#define NSFoundationVersionNumber_iPhoneOS_2_1  678.26
 | 
			
		||||
#define NSFoundationVersionNumber_iPhoneOS_2_2  678.29
 | 
			
		||||
#define NSFoundationVersionNumber_iPhoneOS_3_0  678.47
 | 
			
		||||
#define NSFoundationVersionNumber_iPhoneOS_3_1  678.51
 | 
			
		||||
#define NSFoundationVersionNumber_iPhoneOS_3_2  678.60
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_4_0  751.32
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_4_1  751.37
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_4_2  751.49
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_4_3  751.49
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_5_0  881.00
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_5_1  890.10
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_6_0  992.00
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_6_1  993.00
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_7_0 1047.20
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_7_1 1047.25
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_8_0 1140.11
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_8_1 1141.1
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_8_2 1142.14
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_8_3 1144.17
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_8_4 1144.17
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_8_x_Max 1199
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_9_0 1240.1
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_9_1 1241.14
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_9_2 1242.12
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_9_3 1242.12
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_9_4 1280.25
 | 
			
		||||
#define NSFoundationVersionNumber_iOS_9_x_Max 1299
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@class NSString, Protocol;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSExceptionName NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
typedef NSString * NSRunLoopMode NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSStringFromSelector(SEL aSelector);
 | 
			
		||||
FOUNDATION_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSStringFromClass(Class aClass);
 | 
			
		||||
FOUNDATION_EXPORT Class _Nullable NSClassFromString(NSString *aClassName);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSStringFromProtocol(Protocol *proto) API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT Protocol * _Nullable NSProtocolFromString(NSString *namestr) API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT const char *NSGetSizeAndAlignment(const char *typePtr, NSUInteger * _Nullable sizep, NSUInteger * _Nullable alignp);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT void NSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2) NS_NO_TAIL_CALL;
 | 
			
		||||
FOUNDATION_EXPORT void NSLogv(NSString *format, va_list args) NS_FORMAT_FUNCTION(1,0) NS_NO_TAIL_CALL;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 These constants are used to indicate how items in a request are ordered, from the first one given in a method invocation or function call to the last (that is, left to right in code).
 | 
			
		||||
 
 | 
			
		||||
 Given the function:
 | 
			
		||||
   NSComparisonResult f(int a, int b)
 | 
			
		||||
 
 | 
			
		||||
 If:
 | 
			
		||||
    a < b   then return NSOrderedAscending. The left operand is smaller than the right operand.
 | 
			
		||||
    a > b   then return NSOrderedDescending. The left operand is greater than the right operand.
 | 
			
		||||
    a == b  then return NSOrderedSame. The operands are equal.
 | 
			
		||||
*/
 | 
			
		||||
typedef NS_CLOSED_ENUM(NSInteger, NSComparisonResult) {
 | 
			
		||||
    NSOrderedAscending = -1L,
 | 
			
		||||
    NSOrderedSame,
 | 
			
		||||
    NSOrderedDescending
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSEnumerationOptions) {
 | 
			
		||||
    NSEnumerationConcurrent = (1UL << 0),
 | 
			
		||||
    NSEnumerationReverse = (1UL << 1),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSSortOptions) {
 | 
			
		||||
    NSSortConcurrent = (1UL << 0),
 | 
			
		||||
    NSSortStable = (1UL << 4),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSQualityOfService) {
 | 
			
		||||
    NSQualityOfServiceUserInteractive = 0x21,
 | 
			
		||||
    NSQualityOfServiceUserInitiated = 0x19,
 | 
			
		||||
    NSQualityOfServiceUtility = 0x11,
 | 
			
		||||
    NSQualityOfServiceBackground = 0x09,
 | 
			
		||||
    NSQualityOfServiceDefault = -1
 | 
			
		||||
} API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
static const NSInteger NSNotFound = NSIntegerMax;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
#if !defined(YES)
 | 
			
		||||
    #define YES	(BOOL)1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(NO)
 | 
			
		||||
    #define NO	(BOOL)0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(NS_SUPPRESS_MIN_MAX_ABS)
 | 
			
		||||
 | 
			
		||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__STRICT_ANSI__)
 | 
			
		||||
 | 
			
		||||
#if __clang__
 | 
			
		||||
 | 
			
		||||
#define __NSX_PASTE__(A,B) A##B
 | 
			
		||||
 | 
			
		||||
#if !defined(MIN)
 | 
			
		||||
    #define __NSMIN_IMPL__(A,B,L) ({ __typeof__(A) __NSX_PASTE__(__a,L) = (A); __typeof__(B) __NSX_PASTE__(__b,L) = (B); (__NSX_PASTE__(__a,L) < __NSX_PASTE__(__b,L)) ? __NSX_PASTE__(__a,L) : __NSX_PASTE__(__b,L); })
 | 
			
		||||
    #define MIN(A,B) __NSMIN_IMPL__(A,B,__COUNTER__)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(MAX)
 | 
			
		||||
    #define __NSMAX_IMPL__(A,B,L) ({ __typeof__(A) __NSX_PASTE__(__a,L) = (A); __typeof__(B) __NSX_PASTE__(__b,L) = (B); (__NSX_PASTE__(__a,L) < __NSX_PASTE__(__b,L)) ? __NSX_PASTE__(__b,L) : __NSX_PASTE__(__a,L); })
 | 
			
		||||
    #define MAX(A,B) __NSMAX_IMPL__(A,B,__COUNTER__)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(ABS)
 | 
			
		||||
    #define __NSABS_IMPL__(A,L) ({ __typeof__(A) __NSX_PASTE__(__a,L) = (A); (__NSX_PASTE__(__a,L) < 0) ? - __NSX_PASTE__(__a,L) : __NSX_PASTE__(__a,L); })
 | 
			
		||||
    #define ABS(A) __NSABS_IMPL__(A,__COUNTER__)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
#if !defined(MIN)
 | 
			
		||||
    #define MIN(A,B)	({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __a : __b; })
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(MAX)
 | 
			
		||||
    #define MAX(A,B)	({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(ABS)
 | 
			
		||||
    #define ABS(A)	({ __typeof__(A) __a = (A); __a < 0 ? -__a : __a; })
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
#if !defined(MIN)
 | 
			
		||||
    #define MIN(A,B)	((A) < (B) ? (A) : (B))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(MAX)
 | 
			
		||||
    #define MAX(A,B)	((A) > (B) ? (A) : (B))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(ABS)
 | 
			
		||||
    #define ABS(A)	((A) < 0 ? (-(A)) : (A))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if __has_include(<ptrauth.h>)
 | 
			
		||||
#include <ptrauth.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef __ptrauth_objc_isa_pointer
 | 
			
		||||
#define __ptrauth_objc_isa_pointer
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,127 @@
 | 
			
		||||
/*	NSObject.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#include <TargetConditionals.h>
 | 
			
		||||
#import <objc/NSObject.h>
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
#import <Foundation/NSZone.h>
 | 
			
		||||
 | 
			
		||||
@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
 | 
			
		||||
@class Protocol;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/***************	Basic protocols		***************/
 | 
			
		||||
 | 
			
		||||
@protocol NSCopying
 | 
			
		||||
 | 
			
		||||
- (id)copyWithZone:(nullable NSZone *)zone;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSMutableCopying
 | 
			
		||||
 | 
			
		||||
- (id)mutableCopyWithZone:(nullable NSZone *)zone;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSCoding
 | 
			
		||||
 | 
			
		||||
- (void)encodeWithCoder:(NSCoder *)coder;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder; // NS_DESIGNATED_INITIALIZER
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// Objects which are safe to be encoded and decoded across privilege boundaries should adopt NSSecureCoding instead of NSCoding. Secure coders (those that respond YES to requiresSecureCoding) will only encode objects that adopt the NSSecureCoding protocol.
 | 
			
		||||
// NOTE: NSSecureCoding guarantees only that an archive contains the classes it claims. It makes no guarantees about the suitability for consumption by the receiver of the decoded content of the archive. Archived objects which  may trigger code evaluation should be validated independently by the consumer of the objects to verify that no malicious code is executed (i.e. by checking key paths, selectors etc. specified in the archive).
 | 
			
		||||
 | 
			
		||||
@protocol NSSecureCoding <NSCoding>
 | 
			
		||||
@required
 | 
			
		||||
// This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES.
 | 
			
		||||
// The Secure Coding Guide should be consulted when writing methods that decode data.
 | 
			
		||||
@property (class, readonly) BOOL supportsSecureCoding;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/***********	Base class		***********/
 | 
			
		||||
 | 
			
		||||
@interface NSObject (NSCoderMethods)
 | 
			
		||||
 | 
			
		||||
+ (NSInteger)version;
 | 
			
		||||
+ (void)setVersion:(NSInteger)aVersion;
 | 
			
		||||
@property (readonly) Class classForCoder;
 | 
			
		||||
- (nullable id)replacementObjectForCoder:(NSCoder *)coder;
 | 
			
		||||
- (nullable id)awakeAfterUsingCoder:(NSCoder *)coder NS_REPLACES_RECEIVER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
@interface NSObject (NSDeprecatedMethods)
 | 
			
		||||
 | 
			
		||||
+ (void)poseAsClass:(Class)aClass API_DEPRECATED("Posing no longer supported", macos(10.0,10.5), ios(2.0,2.0), watchos(2.0,2.0), tvos(9.0,9.0))
 | 
			
		||||
#if __OBJC2__
 | 
			
		||||
UNAVAILABLE_ATTRIBUTE
 | 
			
		||||
#endif
 | 
			
		||||
;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/***********	Discardable Content		***********/
 | 
			
		||||
 | 
			
		||||
@protocol NSDiscardableContent
 | 
			
		||||
@required
 | 
			
		||||
- (BOOL)beginContentAccess;
 | 
			
		||||
- (void)endContentAccess;
 | 
			
		||||
- (void)discardContentIfPossible;
 | 
			
		||||
- (BOOL)isContentDiscarded;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSObject (NSDiscardableContentProxy)
 | 
			
		||||
@property (readonly, retain) id autoContentAccessingProxy API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/***********	Object Allocation / Deallocation		*******/
 | 
			
		||||
 | 
			
		||||
// For ARC code that needs this functionality, consider using class_createInstance directly.
 | 
			
		||||
FOUNDATION_EXPORT id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone * _Nullable zone) NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT void NSDeallocateObject(id object) NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT id NSCopyObject(id object, NSUInteger extraBytes, NSZone * _Nullable zone) NS_AUTOMATED_REFCOUNT_UNAVAILABLE API_DEPRECATED("Not supported", macos(10.0,10.8), ios(2.0,6.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSShouldRetainWithZone(id anObject, NSZone * _Nullable requestedZone) NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT void NSIncrementExtraRefCount(id object) NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT BOOL NSDecrementExtraRefCountWasZero(id object) NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSUInteger NSExtraRefCount(id object) NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
#if __has_feature(objc_arc)
 | 
			
		||||
 | 
			
		||||
// After using a CFBridgingRetain on an NSObject, the caller must take responsibility for calling CFRelease at an appropriate time.
 | 
			
		||||
NS_INLINE CF_RETURNS_RETAINED CFTypeRef _Nullable CFBridgingRetain(id _Nullable X) {
 | 
			
		||||
    return (__bridge_retained CFTypeRef)X;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_INLINE id _Nullable CFBridgingRelease(CFTypeRef CF_CONSUMED _Nullable X) {
 | 
			
		||||
    return (__bridge_transfer id)X;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
// This function is intended for use while converting to ARC mode only.
 | 
			
		||||
NS_INLINE CF_RETURNS_RETAINED CFTypeRef _Nullable CFBridgingRetain(id _Nullable X) {
 | 
			
		||||
    return X ? CFRetain((CFTypeRef)X) : NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Casts a CoreFoundation object to an Objective-C object, transferring ownership to ARC (ie. no need to CFRelease to balance a prior +1 CFRetain count). NS_RETURNS_RETAINED is used to indicate that the Objective-C object returned has +1 retain count.  So the object is 'released' as far as CoreFoundation reference counting semantics are concerned, but retained (and in need of releasing) in the view of ARC. This function is intended for use while converting to ARC mode only.
 | 
			
		||||
NS_INLINE id _Nullable CFBridgingRelease(CFTypeRef CF_CONSUMED _Nullable X) NS_RETURNS_RETAINED {
 | 
			
		||||
    return [(id)CFMakeCollectable(X) autorelease];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,38 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSObjectScripting.h
 | 
			
		||||
	Copyright (c) 2002-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSDictionary<KeyType, ObjectType>, NSScriptObjectSpecifier, NSString;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSObject(NSScripting)
 | 
			
		||||
 | 
			
		||||
/* Given an object specifier return the specified object or objects in the receiving container. This might successfully return an object, an array of objects, or nil, depending on the kind of object specifier. Because nil is a valid value, failure is signaled by sending the object specifier -setEvaluationError: before returning. Your override doesn't also have to invoke any of the NSScriptCommand error signaling methods, though it can, to record very specific error information. The NSUnknownKeySpecifierError and NSInvalidIndexSpecifierError numbers are special, in that Cocoa may continue evaluating an outer specifier if they're encountered, for the convenience of scripters.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)scriptingValueForSpecifier:(NSScriptObjectSpecifier *)objectSpecifier API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Getter: */
 | 
			
		||||
/* Return an NSString-keyed dictionary of the object's scriptable properties, including all of those that are declared as properties or contents in the .sdef declaration (or Attributes and ToOneRelationships in the .scriptSuite declaration) of the class and its scripting superclasses, with the exception of ones keyed by "scriptingProperties." Each key in the dictionary must be identical to the key for an attribute or to-one relationship. The values of the dictionary must be Objective-C objects that are convertible to NSAppleEventDescriptors.
 | 
			
		||||
*/
 | 
			
		||||
/* Setter: */
 | 
			
		||||
/* Given an NSString-keyed dictionary, set one or more scriptable properties of the object. The valid keys for the dictionary include the keys for writable properties and contents in the .sdef declaration (or non-read-only Attributes and ToOneRelationships in the .scriptSuite declaration) of the object's class and its scripting superclasses, and no others. In other words, invokers of this method must have already done any necessary validation to ensure that the properties dictionary includes nothing but entries for declared, settable attributes and to-one relationships. Implementations of this method are not expected to check the validity of keys in the passed-in dictionary, but must be able accept dictionaries that do not contain entries for every scriptable property. The values of the dictionary are Objective-C objects.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, copy) NSDictionary<NSString *, id> *scriptingProperties;
 | 
			
		||||
 | 
			
		||||
/* Create one or more scripting objects to be inserted into the relationship identified by the key by copying the passed-in value, set the properties in the copied object or objects, and return it or them. The value is, for example, derived from the receivers of a Duplicate command. Its type must match the type of the property identified by the key. For example, if the property is an ordered to-many relationship, the value will always be an array of objects to be copied, and an array of objects must therefore be returned. The properties are derived from the "with properties" parameter of a Duplicate command. When this method is invoked by Cocoa neither the value nor the properties will have yet been coerced using scripting key-value coding's -coerceValue:forKey: method. In .sdef-declared scriptability the types of the passed-in objects reliably match the relevant .sdef declarations however.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)copyScriptingValue:(id)value forKey:(NSString *)key withProperties:(NSDictionary<NSString *, id> *)properties API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
/* Create a new instance of a scriptable class to be inserted into the relationship identified by the key, set the contentsValue and properties of it, and return it. Or return nil for failure. The contentsValue and properties are derived from the "with contents" and "with properties" parameters of a Make command. The contentsValue may be nil. When this method is invoked by Cocoa neither the contentsValue nor the properties will have yet been coerced using scripting key-value coding's -coerceValue:forKey: method. In .sdef-declared scriptability the types of the passed-in objects reliably match the relevant .sdef declarations however.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)newScriptingObjectOfClass:(Class)objectClass forValueForKey:(NSString *)key withContentsValue:(nullable id)contentsValue properties:(NSDictionary<NSString *, id> *)properties API_AVAILABLE(macos(10.5)) API_UNAVAILABLE(ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,189 @@
 | 
			
		||||
/*	NSOperation.h
 | 
			
		||||
	Copyright (c) 2006-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSException.h>
 | 
			
		||||
#import <Foundation/NSProgress.h>
 | 
			
		||||
#import <sys/qos.h>
 | 
			
		||||
#import <dispatch/dispatch.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>, NSSet;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
#define NSOperationQualityOfService NSQualityOfService
 | 
			
		||||
#define NSOperationQualityOfServiceUserInteractive NSQualityOfServiceUserInteractive
 | 
			
		||||
#define NSOperationQualityOfServiceUserInitiated NSQualityOfServiceUserInitiated
 | 
			
		||||
#define NSOperationQualityOfServiceUtility NSQualityOfServiceUtility
 | 
			
		||||
#define NSOperationQualityOfServiceBackground NSQualityOfServiceBackground
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSOperation : NSObject
 | 
			
		||||
#if !__OBJC2__
 | 
			
		||||
{
 | 
			
		||||
@private
 | 
			
		||||
    id _private;
 | 
			
		||||
    int32_t _private1;
 | 
			
		||||
#if __LP64__
 | 
			
		||||
    int32_t _private1b;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
- (void)start;
 | 
			
		||||
- (void)main;
 | 
			
		||||
 | 
			
		||||
@property (readonly, getter=isCancelled) BOOL cancelled;
 | 
			
		||||
- (void)cancel;
 | 
			
		||||
 | 
			
		||||
@property (readonly, getter=isExecuting) BOOL executing;
 | 
			
		||||
@property (readonly, getter=isFinished) BOOL finished;
 | 
			
		||||
@property (readonly, getter=isConcurrent) BOOL concurrent; // To be deprecated; use and override 'asynchronous' below
 | 
			
		||||
@property (readonly, getter=isAsynchronous) BOOL asynchronous API_AVAILABLE(macos(10.8), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, getter=isReady) BOOL ready;
 | 
			
		||||
 | 
			
		||||
- (void)addDependency:(NSOperation *)op;
 | 
			
		||||
- (void)removeDependency:(NSOperation *)op;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSOperation *> *dependencies;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSOperationQueuePriority) {
 | 
			
		||||
	NSOperationQueuePriorityVeryLow = -8L,
 | 
			
		||||
	NSOperationQueuePriorityLow = -4L,
 | 
			
		||||
	NSOperationQueuePriorityNormal = 0,
 | 
			
		||||
	NSOperationQueuePriorityHigh = 4,
 | 
			
		||||
	NSOperationQueuePriorityVeryHigh = 8
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@property NSOperationQueuePriority queuePriority;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) void (^completionBlock)(void) API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (void)waitUntilFinished API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property double threadPriority API_DEPRECATED("Not supported", macos(10.6,10.10), ios(4.0,8.0), watchos(2.0,2.0), tvos(9.0,9.0));
 | 
			
		||||
 | 
			
		||||
@property NSQualityOfService qualityOfService API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSString *name API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSBlockOperation : NSOperation
 | 
			
		||||
#if !__OBJC2__
 | 
			
		||||
{
 | 
			
		||||
@private
 | 
			
		||||
    id _private2;
 | 
			
		||||
    void *_reserved2;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
+ (instancetype)blockOperationWithBlock:(void (^)(void))block;
 | 
			
		||||
 | 
			
		||||
- (void)addExecutionBlock:(void (^)(void))block;
 | 
			
		||||
@property (readonly, copy) NSArray<void (^)(void)> *executionBlocks;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("NSInvocation and related APIs not available")
 | 
			
		||||
@interface NSInvocationOperation : NSOperation
 | 
			
		||||
#if !__OBJC2__
 | 
			
		||||
{
 | 
			
		||||
@private
 | 
			
		||||
    id _inv;
 | 
			
		||||
    id _exception;
 | 
			
		||||
    void *_reserved2;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithTarget:(id)target selector:(SEL)sel object:(nullable id)arg;
 | 
			
		||||
- (instancetype)initWithInvocation:(NSInvocation *)inv NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property (readonly, retain) NSInvocation *invocation;
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, retain) id result;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSInvocationOperationVoidResultException API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
FOUNDATION_EXPORT NSExceptionName const NSInvocationOperationCancelledException API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
static const NSInteger NSOperationQueueDefaultMaxConcurrentOperationCount = -1;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSOperationQueue : NSObject <NSProgressReporting>
 | 
			
		||||
#if !__OBJC2__
 | 
			
		||||
{
 | 
			
		||||
@private
 | 
			
		||||
    id _private;
 | 
			
		||||
    void *_reserved;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/// @property progress
 | 
			
		||||
/// @discussion     The `progress` property represents a total progress of the operations executed in the queue. By default NSOperationQueue
 | 
			
		||||
/// does not report progress until the `totalUnitCount` of the progress is set. When the `totalUnitCount` property of the progress is set the
 | 
			
		||||
/// queue then opts into participating in progress reporting. When enabled, each operation will contribute 1 unit of completion to the
 | 
			
		||||
/// overall progress of the queue for operations that are finished by the end of main (operations that override start and do not invoke super
 | 
			
		||||
/// will not contribute to progress). Special attention to race conditions should be made when updating the `totalUnitCount` of the progress
 | 
			
		||||
/// as well as care should be taken to avoid 'backwards progress'. For example; when a NSOperationQueue's progress is 5/10, representing 50%
 | 
			
		||||
/// completed, and there are 90 more operations about to be added and the `totalUnitCount` that would then make the progress report as 5/100
 | 
			
		||||
/// which represents 5%. In this example it would mean that any progress bar would jump from displaying 50% back to 5%, which might not be
 | 
			
		||||
/// desirable. In the cases where the `totalUnitCount` needs to be adjusted it is suggested to do this for thread-safety in a barrier by
 | 
			
		||||
/// using the `addBarrierBlock:` API. This ensures that no un-expected execution state occurs adjusting into a potentially backwards moving
 | 
			
		||||
/// progress scenario.
 | 
			
		||||
///
 | 
			
		||||
/// @example
 | 
			
		||||
/// NSOperationQueue *queue = [[NSOperationQueue alloc] init];
 | 
			
		||||
/// queue.progress.totalUnitCount = 10;
 | 
			
		||||
@property (readonly, strong) NSProgress *progress API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
 | 
			
		||||
 | 
			
		||||
- (void)addOperation:(NSOperation *)op;
 | 
			
		||||
- (void)addOperations:(NSArray<NSOperation *> *)ops waitUntilFinished:(BOOL)wait API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (void)addOperationWithBlock:(void (^)(void))block API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) NS_SWIFT_DISABLE_ASYNC;
 | 
			
		||||
 | 
			
		||||
/// @method addBarrierBlock:
 | 
			
		||||
/// @param barrier      A block to execute
 | 
			
		||||
/// @discussion         The `addBarrierBlock:` method executes the block when the NSOperationQueue has finished all enqueued operations and
 | 
			
		||||
/// prevents any subsequent operations to be executed until the barrier has been completed. This acts similarly to the
 | 
			
		||||
/// `dispatch_barrier_async` function.
 | 
			
		||||
- (void)addBarrierBlock:(void (^)(void))barrier API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
 | 
			
		||||
 | 
			
		||||
@property NSInteger maxConcurrentOperationCount;
 | 
			
		||||
 | 
			
		||||
@property (getter=isSuspended) BOOL suspended;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSString *name API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property NSQualityOfService qualityOfService API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@property (nullable, assign /* actually retain */) dispatch_queue_t underlyingQueue API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (void)cancelAllOperations;
 | 
			
		||||
 | 
			
		||||
- (void)waitUntilAllOperationsAreFinished;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong, nullable) NSOperationQueue *currentQueue API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (class, readonly, strong) NSOperationQueue *mainQueue API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSOperationQueue (NSDeprecated)
 | 
			
		||||
 | 
			
		||||
// These two functions are inherently a race condition and should be avoided if possible
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<__kindof NSOperation *> *operations API_DEPRECATED("access to operations is inherently a race condition, it should not be used. For barrier style behaviors please use addBarrierBlock: instead", macos(10.5, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger operationCount API_DEPRECATED_WITH_REPLACEMENT("progress.completedUnitCount", macos(10.6, API_TO_BE_DEPRECATED), ios(4.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,63 @@
 | 
			
		||||
/*	NSOrderedCollectionChange.h
 | 
			
		||||
	Copyright (c) 2017-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSCollectionChangeType) {
 | 
			
		||||
    NSCollectionChangeInsert,
 | 
			
		||||
    NSCollectionChangeRemove
 | 
			
		||||
} API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0))
 | 
			
		||||
@interface NSOrderedCollectionChange<ObjectType> : NSObject
 | 
			
		||||
#ifndef __OBJC2__
 | 
			
		||||
{
 | 
			
		||||
@private
 | 
			
		||||
    id _object;
 | 
			
		||||
    NSCollectionChangeType _changeType;
 | 
			
		||||
    NSUInteger _index;
 | 
			
		||||
    NSUInteger _associatedIndex;
 | 
			
		||||
}
 | 
			
		||||
#endif // !__OBJC2__
 | 
			
		||||
 | 
			
		||||
+ (NSOrderedCollectionChange<ObjectType> *)changeWithObject:(nullable ObjectType)anObject
 | 
			
		||||
                                                       type:(NSCollectionChangeType)type
 | 
			
		||||
                                                      index:(NSUInteger)index;
 | 
			
		||||
 | 
			
		||||
+ (NSOrderedCollectionChange<ObjectType> *)changeWithObject:(nullable ObjectType)anObject
 | 
			
		||||
                                                       type:(NSCollectionChangeType)type
 | 
			
		||||
                                                      index:(NSUInteger)index
 | 
			
		||||
                                            associatedIndex:(NSUInteger)associatedIndex;
 | 
			
		||||
 | 
			
		||||
// The object that was inserted or removed, if recorded
 | 
			
		||||
@property (readonly, strong, nullable) ObjectType object;
 | 
			
		||||
 | 
			
		||||
// The change type: insert or remove
 | 
			
		||||
@property (readonly) NSCollectionChangeType changeType;
 | 
			
		||||
 | 
			
		||||
// For removes, the index of the object in the original state.
 | 
			
		||||
// For inserts, the index of the object in the final state.
 | 
			
		||||
@property (readonly) NSUInteger index;
 | 
			
		||||
 | 
			
		||||
// When non-NSNotFound, indicates that this change is one half of a move, with
 | 
			
		||||
// this value referring to the index of the other change that completes it.
 | 
			
		||||
// For differences produced by identity comparison (instead of equality), each
 | 
			
		||||
// change representing a move operation may store different objects.
 | 
			
		||||
@property (readonly) NSUInteger associatedIndex;
 | 
			
		||||
 | 
			
		||||
- (id)init API_UNAVAILABLE(macos, ios, watchos, tvos);
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithObject:(nullable ObjectType)anObject
 | 
			
		||||
                          type:(NSCollectionChangeType)type
 | 
			
		||||
                         index:(NSUInteger)index;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithObject:(nullable ObjectType)anObject
 | 
			
		||||
                          type:(NSCollectionChangeType)type
 | 
			
		||||
                         index:(NSUInteger)index
 | 
			
		||||
               associatedIndex:(NSUInteger)associatedIndex NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,80 @@
 | 
			
		||||
/*	NSOrderedCollectionDifference.h
 | 
			
		||||
	Copyright (c) 2017-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
@class NSArray<ObjectType>;
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSOrderedCollectionChange.h>
 | 
			
		||||
#import <Foundation/NSIndexSet.h>
 | 
			
		||||
#import <Foundation/NSEnumerator.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/// Options supported by methods that produce difference objects.
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSOrderedCollectionDifferenceCalculationOptions) {
 | 
			
		||||
    /// Insertion changes do not store a reference to the inserted object.
 | 
			
		||||
    NSOrderedCollectionDifferenceCalculationOmitInsertedObjects = (1 << 0UL),
 | 
			
		||||
    /// Insertion changes do not store a reference to the removed object.
 | 
			
		||||
    NSOrderedCollectionDifferenceCalculationOmitRemovedObjects = (1 << 1UL),
 | 
			
		||||
    /// Assume objects that were uniquely removed and inserted were moved.
 | 
			
		||||
    /// This is useful when diffing based on identity instead of equality.
 | 
			
		||||
    NSOrderedCollectionDifferenceCalculationInferMoves = (1 << 2UL)
 | 
			
		||||
} API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0))
 | 
			
		||||
@interface NSOrderedCollectionDifference<ObjectType> : NSObject <NSFastEnumeration>
 | 
			
		||||
#ifndef __OBJC2__
 | 
			
		||||
{
 | 
			
		||||
@private
 | 
			
		||||
    id _removeIndexes;
 | 
			
		||||
    id _removeObjects;
 | 
			
		||||
    id _insertIndexes;
 | 
			
		||||
    id _insertObjects;
 | 
			
		||||
    id _moves;
 | 
			
		||||
}
 | 
			
		||||
#endif // !__OBJC2__
 | 
			
		||||
 | 
			
		||||
/// Creates a new difference representing the changes in the parameter.
 | 
			
		||||
///
 | 
			
		||||
/// For clients interested in the difference between two collections, the
 | 
			
		||||
/// collection's differenceFrom method should be used instead.
 | 
			
		||||
///
 | 
			
		||||
/// To guarantee that instances are unambiguous and safe for compatible base
 | 
			
		||||
/// states, this method requires that its parameter conform to the following
 | 
			
		||||
/// requirements:
 | 
			
		||||
///
 | 
			
		||||
/// 1) All insertion offsets are unique
 | 
			
		||||
/// 2) All removal offsets are unique
 | 
			
		||||
/// 3) All associated indexes match a change with the opposite parity.
 | 
			
		||||
- (instancetype)initWithChanges:(NSArray<NSOrderedCollectionChange<ObjectType> *> *)changes;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithInsertIndexes:(NSIndexSet *)inserts
 | 
			
		||||
                      insertedObjects:(nullable NSArray<ObjectType> *)insertedObjects
 | 
			
		||||
                        removeIndexes:(NSIndexSet *)removes
 | 
			
		||||
                       removedObjects:(nullable NSArray<ObjectType> *)removedObjects
 | 
			
		||||
                    additionalChanges:(NSArray<NSOrderedCollectionChange<ObjectType> *> *)changes NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithInsertIndexes:(NSIndexSet *)inserts
 | 
			
		||||
                      insertedObjects:(nullable NSArray<ObjectType> *)insertedObjects
 | 
			
		||||
                        removeIndexes:(NSIndexSet *)removes
 | 
			
		||||
                       removedObjects:(nullable NSArray<ObjectType> *)removedObjects;
 | 
			
		||||
 | 
			
		||||
@property (strong, readonly) NSArray<NSOrderedCollectionChange<ObjectType> *> *insertions API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
@property (strong, readonly) NSArray<NSOrderedCollectionChange<ObjectType> *> *removals API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
@property (assign, readonly) BOOL hasChanges;
 | 
			
		||||
 | 
			
		||||
// Create a new difference by mapping over this difference's members
 | 
			
		||||
- (NSOrderedCollectionDifference<id> *)differenceByTransformingChangesWithBlock:(NSOrderedCollectionChange<id> *(NS_NOESCAPE ^)(NSOrderedCollectionChange<ObjectType> *))block;
 | 
			
		||||
 | 
			
		||||
// Returns a difference that is the inverse of the receiver.
 | 
			
		||||
//
 | 
			
		||||
// In other words, given a valid difference `diff` the array `a` is equal to
 | 
			
		||||
// [[a arrayByApplyingDifference:diff] arrayByApplyingDifference:diff.inverseDifference]
 | 
			
		||||
//
 | 
			
		||||
// To revert a chronological sequence of diffs, apply their inverses in reverse order.
 | 
			
		||||
- (instancetype)inverseDifference API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,191 @@
 | 
			
		||||
/*	NSOrderedSet.h
 | 
			
		||||
	Copyright (c) 2007-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSRange.h>
 | 
			
		||||
#import <Foundation/NSEnumerator.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSOrderedCollectionDifference.h>
 | 
			
		||||
 | 
			
		||||
@class NSArray, NSIndexSet, NSSet<ObjectType>, NSString;
 | 
			
		||||
 | 
			
		||||
/****************       Immutable Ordered Set   ****************/
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSOrderedSet<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSUInteger count;
 | 
			
		||||
- (ObjectType)objectAtIndex:(NSUInteger)idx;
 | 
			
		||||
- (NSUInteger)indexOfObject:(ObjectType)object;
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithObjects:(const ObjectType _Nonnull [_Nullable])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSOrderedSet<ObjectType> (NSExtendedOrderedSet)
 | 
			
		||||
 | 
			
		||||
- (void)getObjects:(ObjectType _Nonnull __unsafe_unretained [_Nullable])objects range:(NSRange)range NS_SWIFT_UNAVAILABLE("Use 'array' instead");
 | 
			
		||||
- (NSArray<ObjectType> *)objectsAtIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
@property (nullable, nonatomic, readonly) ObjectType firstObject;
 | 
			
		||||
@property (nullable, nonatomic, readonly) ObjectType lastObject;
 | 
			
		||||
 | 
			
		||||
- (BOOL)isEqualToOrderedSet:(NSOrderedSet<ObjectType> *)other;
 | 
			
		||||
 | 
			
		||||
- (BOOL)containsObject:(ObjectType)object;
 | 
			
		||||
- (BOOL)intersectsOrderedSet:(NSOrderedSet<ObjectType> *)other;
 | 
			
		||||
- (BOOL)intersectsSet:(NSSet<ObjectType> *)set;
 | 
			
		||||
 | 
			
		||||
- (BOOL)isSubsetOfOrderedSet:(NSOrderedSet<ObjectType> *)other;
 | 
			
		||||
- (BOOL)isSubsetOfSet:(NSSet<ObjectType> *)set;
 | 
			
		||||
 | 
			
		||||
- (ObjectType)objectAtIndexedSubscript:(NSUInteger)idx API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (NSEnumerator<ObjectType> *)objectEnumerator;
 | 
			
		||||
- (NSEnumerator<ObjectType> *)reverseObjectEnumerator;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSOrderedSet<ObjectType> *reversedOrderedSet;
 | 
			
		||||
 | 
			
		||||
// These two methods return a facade object for the receiving ordered set,
 | 
			
		||||
// which acts like an immutable array or set (respectively).  Note that
 | 
			
		||||
// while you cannot mutate the ordered set through these facades, mutations
 | 
			
		||||
// to the original ordered set will "show through" the facade and it will
 | 
			
		||||
// appear to change spontaneously, since a copy of the ordered set is not
 | 
			
		||||
// being made.
 | 
			
		||||
@property (readonly, strong) NSArray<ObjectType> *array;
 | 
			
		||||
@property (readonly, strong) NSSet<ObjectType> *set;
 | 
			
		||||
 | 
			
		||||
- (void)enumerateObjectsUsingBlock:(void (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))block;
 | 
			
		||||
- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))block;
 | 
			
		||||
- (void)enumerateObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))block;
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)indexOfObjectPassingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate;
 | 
			
		||||
- (NSUInteger)indexOfObjectWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate;
 | 
			
		||||
- (NSUInteger)indexOfObjectAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate;
 | 
			
		||||
 | 
			
		||||
- (NSIndexSet *)indexesOfObjectsPassingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate;
 | 
			
		||||
- (NSIndexSet *)indexesOfObjectsWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate;
 | 
			
		||||
- (NSIndexSet *)indexesOfObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts passingTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj, NSUInteger idx, BOOL *stop))predicate;
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)indexOfObject:(ObjectType)object inSortedRange:(NSRange)range options:(NSBinarySearchingOptions)opts usingComparator:(NSComparator NS_NOESCAPE)cmp; // binary search
 | 
			
		||||
 | 
			
		||||
- (NSArray<ObjectType> *)sortedArrayUsingComparator:(NSComparator NS_NOESCAPE)cmptr;
 | 
			
		||||
- (NSArray<ObjectType> *)sortedArrayWithOptions:(NSSortOptions)opts usingComparator:(NSComparator NS_NOESCAPE)cmptr;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *description;
 | 
			
		||||
- (NSString *)descriptionWithLocale:(nullable id)locale;
 | 
			
		||||
- (NSString *)descriptionWithLocale:(nullable id)locale indent:(NSUInteger)level;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSOrderedSet<ObjectType> (NSOrderedSetCreation)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)orderedSet;
 | 
			
		||||
+ (instancetype)orderedSetWithObject:(ObjectType)object;
 | 
			
		||||
+ (instancetype)orderedSetWithObjects:(const ObjectType _Nonnull [_Nonnull])objects count:(NSUInteger)cnt;
 | 
			
		||||
+ (instancetype)orderedSetWithObjects:(ObjectType)firstObj, ... NS_REQUIRES_NIL_TERMINATION;
 | 
			
		||||
+ (instancetype)orderedSetWithOrderedSet:(NSOrderedSet<ObjectType> *)set;
 | 
			
		||||
+ (instancetype)orderedSetWithOrderedSet:(NSOrderedSet<ObjectType> *)set range:(NSRange)range copyItems:(BOOL)flag;
 | 
			
		||||
+ (instancetype)orderedSetWithArray:(NSArray<ObjectType> *)array;
 | 
			
		||||
+ (instancetype)orderedSetWithArray:(NSArray<ObjectType> *)array range:(NSRange)range copyItems:(BOOL)flag;
 | 
			
		||||
+ (instancetype)orderedSetWithSet:(NSSet<ObjectType> *)set;
 | 
			
		||||
+ (instancetype)orderedSetWithSet:(NSSet<ObjectType> *)set copyItems:(BOOL)flag;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithObject:(ObjectType)object;
 | 
			
		||||
- (instancetype)initWithObjects:(ObjectType)firstObj, ... NS_REQUIRES_NIL_TERMINATION;
 | 
			
		||||
- (instancetype)initWithOrderedSet:(NSOrderedSet<ObjectType> *)set;
 | 
			
		||||
- (instancetype)initWithOrderedSet:(NSOrderedSet<ObjectType> *)set copyItems:(BOOL)flag;
 | 
			
		||||
- (instancetype)initWithOrderedSet:(NSOrderedSet<ObjectType> *)set range:(NSRange)range copyItems:(BOOL)flag;
 | 
			
		||||
- (instancetype)initWithArray:(NSArray<ObjectType> *)array;
 | 
			
		||||
- (instancetype)initWithArray:(NSArray<ObjectType> *)set copyItems:(BOOL)flag;
 | 
			
		||||
- (instancetype)initWithArray:(NSArray<ObjectType> *)set range:(NSRange)range copyItems:(BOOL)flag;
 | 
			
		||||
- (instancetype)initWithSet:(NSSet<ObjectType> *)set;
 | 
			
		||||
- (instancetype)initWithSet:(NSSet<ObjectType> *)set copyItems:(BOOL)flag;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0))
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("NSOrderedSet diffing methods are not available in Swift, use Collection.difference(from:) instead")
 | 
			
		||||
@interface NSOrderedSet<ObjectType> (NSOrderedSetDiffing)
 | 
			
		||||
 | 
			
		||||
- (NSOrderedCollectionDifference<ObjectType> *)differenceFromOrderedSet:(NSOrderedSet<ObjectType> *)other withOptions:(NSOrderedCollectionDifferenceCalculationOptions)options usingEquivalenceTest:(BOOL (NS_NOESCAPE ^)(ObjectType obj1, ObjectType obj2))block;
 | 
			
		||||
 | 
			
		||||
- (NSOrderedCollectionDifference<ObjectType> *)differenceFromOrderedSet:(NSOrderedSet<ObjectType> *)other withOptions:(NSOrderedCollectionDifferenceCalculationOptions)options;
 | 
			
		||||
 | 
			
		||||
// Uses isEqual: to determine the difference between the parameter and the receiver
 | 
			
		||||
- (NSOrderedCollectionDifference<ObjectType> *)differenceFromOrderedSet:(NSOrderedSet<ObjectType> *)other;
 | 
			
		||||
 | 
			
		||||
- (nullable NSOrderedSet<ObjectType> *)orderedSetByApplyingDifference:(NSOrderedCollectionDifference<ObjectType> *)difference;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/****************       Mutable Ordered Set     ****************/
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.7), ios(5.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSMutableOrderedSet<ObjectType> : NSOrderedSet<ObjectType>
 | 
			
		||||
 | 
			
		||||
- (void)insertObject:(ObjectType)object atIndex:(NSUInteger)idx;
 | 
			
		||||
- (void)removeObjectAtIndex:(NSUInteger)idx;
 | 
			
		||||
- (void)replaceObjectAtIndex:(NSUInteger)idx withObject:(ObjectType)object;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithCapacity:(NSUInteger)numItems NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableOrderedSet<ObjectType> (NSExtendedMutableOrderedSet)
 | 
			
		||||
 | 
			
		||||
- (void)addObject:(ObjectType)object;
 | 
			
		||||
- (void)addObjects:(const ObjectType _Nonnull [_Nullable])objects count:(NSUInteger)count;
 | 
			
		||||
- (void)addObjectsFromArray:(NSArray<ObjectType> *)array;
 | 
			
		||||
 | 
			
		||||
- (void)exchangeObjectAtIndex:(NSUInteger)idx1 withObjectAtIndex:(NSUInteger)idx2;
 | 
			
		||||
- (void)moveObjectsAtIndexes:(NSIndexSet *)indexes toIndex:(NSUInteger)idx;
 | 
			
		||||
 | 
			
		||||
- (void)insertObjects:(NSArray<ObjectType> *)objects atIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
 | 
			
		||||
- (void)setObject:(ObjectType)obj atIndex:(NSUInteger)idx;
 | 
			
		||||
- (void)setObject:(ObjectType)obj atIndexedSubscript:(NSUInteger)idx API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (void)replaceObjectsInRange:(NSRange)range withObjects:(const ObjectType _Nonnull [_Nullable])objects count:(NSUInteger)count;
 | 
			
		||||
- (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withObjects:(NSArray<ObjectType> *)objects;
 | 
			
		||||
 | 
			
		||||
- (void)removeObjectsInRange:(NSRange)range;
 | 
			
		||||
- (void)removeObjectsAtIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
- (void)removeAllObjects;
 | 
			
		||||
 | 
			
		||||
- (void)removeObject:(ObjectType)object;
 | 
			
		||||
- (void)removeObjectsInArray:(NSArray<ObjectType> *)array;
 | 
			
		||||
 | 
			
		||||
- (void)intersectOrderedSet:(NSOrderedSet<ObjectType> *)other;
 | 
			
		||||
- (void)minusOrderedSet:(NSOrderedSet<ObjectType> *)other;
 | 
			
		||||
- (void)unionOrderedSet:(NSOrderedSet<ObjectType> *)other;
 | 
			
		||||
 | 
			
		||||
- (void)intersectSet:(NSSet<ObjectType> *)other;
 | 
			
		||||
- (void)minusSet:(NSSet<ObjectType> *)other;
 | 
			
		||||
- (void)unionSet:(NSSet<ObjectType> *)other;
 | 
			
		||||
 | 
			
		||||
- (void)sortUsingComparator:(NSComparator NS_NOESCAPE)cmptr;
 | 
			
		||||
- (void)sortWithOptions:(NSSortOptions)opts usingComparator:(NSComparator NS_NOESCAPE)cmptr;
 | 
			
		||||
- (void)sortRange:(NSRange)range options:(NSSortOptions)opts usingComparator:(NSComparator NS_NOESCAPE)cmptr;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableOrderedSet<ObjectType> (NSMutableOrderedSetCreation)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)orderedSetWithCapacity:(NSUInteger)numItems;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macosx(10.15), ios(13.0), watchos(6.0), tvos(13.0))
 | 
			
		||||
NS_SWIFT_UNAVAILABLE("NSMutableOrderedSet diffing methods are not available in Swift")
 | 
			
		||||
@interface NSMutableOrderedSet<ObjectType> (NSMutableOrderedSetDiffing)
 | 
			
		||||
 | 
			
		||||
- (void)applyDifference:(NSOrderedCollectionDifference<ObjectType> *)difference;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,45 @@
 | 
			
		||||
/*	NSOrthography.h
 | 
			
		||||
	Copyright (c) 2008-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
 | 
			
		||||
@class NSString, NSArray<ObjectType>, NSDictionary<KeyType, ObjectType>;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* NSOrthography is a class used to describe the linguistic content of a piece of text, especially for the purposes of spelling and grammar checking.  It describes (a) which scripts the text contains, (b) a dominant language and possibly other languages for each of these scripts, and (c) a dominant script and language for the text as a whole.  Scripts are uniformly described by standard four-letter tags (Latn, Grek, Cyrl, etc.) with the supertags Jpan and Kore typically used for Japanese and Korean text, Hans and Hant for Chinese text; the tag Zyyy is used if a specific script cannot be identified.  Languages are uniformly described by BCP-47 tags, preferably in canonical form; the tag und is used if a specific language cannot be determined. */
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSOrthography : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
/* These are the primitive properties which a subclass must implement.  The dominantScript should be a script tag (such as Latn, Cyrl, and so forth) and the languageMap should be a dictionary whose keys are script tags and whose values are arrays of language tags (such as en, fr, de, and so forth). */
 | 
			
		||||
@property (readonly, copy) NSString *dominantScript;
 | 
			
		||||
@property (readonly, copy) NSDictionary<NSString *, NSArray<NSString *> *> *languageMap;
 | 
			
		||||
- (instancetype)initWithDominantScript:(NSString *)script languageMap:(NSDictionary<NSString *, NSArray<NSString *> *> *)map API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSOrthography (NSOrthographyExtended)
 | 
			
		||||
 | 
			
		||||
/* languagesForScript: returns the list of languages for the specified script, and dominantLanguageForScript: returns the first item on that list. */
 | 
			
		||||
- (nullable NSArray<NSString *> *)languagesForScript:(NSString *)script API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (nullable NSString *)dominantLanguageForScript:(NSString *)script API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
/*  The dominantLanguage is the first in the list of languages for the dominant script, allScripts includes the dominant script and all others appearing as keys in the language map, and allLanguages includes all languages appearing in the values of the language map. */
 | 
			
		||||
@property (readonly, copy) NSString *dominantLanguage API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *allScripts API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *allLanguages API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
+ (instancetype)defaultOrthographyForLanguage:(NSString *)language API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSOrthography (NSOrthographyCreation)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)orthographyWithDominantScript:(NSString *)script languageMap:(NSDictionary<NSString *, NSArray<NSString *> *> *)map API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,98 @@
 | 
			
		||||
/*	NSPathUtilities.h
 | 
			
		||||
	Copyright (c) 1994-2019, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@interface NSString (NSStringPathExtensions)
 | 
			
		||||
 | 
			
		||||
+ (NSString *)pathWithComponents:(NSArray<NSString *> *)components;
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *pathComponents;
 | 
			
		||||
 | 
			
		||||
@property (getter=isAbsolutePath, readonly) BOOL absolutePath;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *lastPathComponent;
 | 
			
		||||
@property (readonly, copy) NSString *stringByDeletingLastPathComponent;
 | 
			
		||||
- (NSString *)stringByAppendingPathComponent:(NSString *)str;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *pathExtension;
 | 
			
		||||
@property (readonly, copy) NSString *stringByDeletingPathExtension;
 | 
			
		||||
- (nullable NSString *)stringByAppendingPathExtension:(NSString *)str;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *stringByAbbreviatingWithTildeInPath;
 | 
			
		||||
@property (readonly, copy) NSString *stringByExpandingTildeInPath;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *stringByStandardizingPath;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSString *stringByResolvingSymlinksInPath;
 | 
			
		||||
 | 
			
		||||
- (NSArray<NSString *> *)stringsByAppendingPaths:(NSArray<NSString *> *)paths;
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)completePathIntoString:(NSString * _Nullable * _Nullable)outputName caseSensitive:(BOOL)flag matchesIntoArray:(NSArray<NSString *> * _Nullable * _Nullable)outputArray filterTypes:(nullable NSArray<NSString *> *)filterTypes;
 | 
			
		||||
 | 
			
		||||
@property (readonly) const char *fileSystemRepresentation NS_RETURNS_INNER_POINTER;
 | 
			
		||||
- (BOOL)getFileSystemRepresentation:(char *)cname maxLength:(NSUInteger)max;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSArray<ObjectType> (NSArrayPathExtensions)
 | 
			
		||||
 | 
			
		||||
- (NSArray<NSString *> *)pathsMatchingExtensions:(NSArray<NSString *> *)filterTypes;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSUserName(void);
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSFullUserName(void);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSHomeDirectory(void);
 | 
			
		||||
FOUNDATION_EXPORT NSString * _Nullable NSHomeDirectoryForUser(NSString * _Nullable userName);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSTemporaryDirectory(void);
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSString *NSOpenStepRootDirectory(void);
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSSearchPathDirectory) {
 | 
			
		||||
    NSApplicationDirectory = 1,             // supported applications (Applications)
 | 
			
		||||
    NSDemoApplicationDirectory,             // unsupported applications, demonstration versions (Demos)
 | 
			
		||||
    NSDeveloperApplicationDirectory,        // developer applications (Developer/Applications). DEPRECATED - there is no one single Developer directory.
 | 
			
		||||
    NSAdminApplicationDirectory,            // system and network administration applications (Administration)
 | 
			
		||||
    NSLibraryDirectory,                     // various documentation, support, and configuration files, resources (Library)
 | 
			
		||||
    NSDeveloperDirectory,                   // developer resources (Developer) DEPRECATED - there is no one single Developer directory.
 | 
			
		||||
    NSUserDirectory,                        // user home directories (Users)
 | 
			
		||||
    NSDocumentationDirectory,               // documentation (Documentation)
 | 
			
		||||
    NSDocumentDirectory,                    // documents (Documents)
 | 
			
		||||
    NSCoreServiceDirectory,                 // location of CoreServices directory (System/Library/CoreServices)
 | 
			
		||||
    NSAutosavedInformationDirectory API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 11,   // location of autosaved documents (Documents/Autosaved)
 | 
			
		||||
    NSDesktopDirectory = 12,                // location of user's desktop
 | 
			
		||||
    NSCachesDirectory = 13,                 // location of discardable cache files (Library/Caches)
 | 
			
		||||
    NSApplicationSupportDirectory = 14,     // location of application support files (plug-ins, etc) (Library/Application Support)
 | 
			
		||||
    NSDownloadsDirectory API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0)) = 15,              // location of the user's "Downloads" directory
 | 
			
		||||
    NSInputMethodsDirectory API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 16,           // input methods (Library/Input Methods)
 | 
			
		||||
    NSMoviesDirectory API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 17,                 // location of user's Movies directory (~/Movies)
 | 
			
		||||
    NSMusicDirectory API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 18,                  // location of user's Music directory (~/Music)
 | 
			
		||||
    NSPicturesDirectory API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 19,               // location of user's Pictures directory (~/Pictures)
 | 
			
		||||
    NSPrinterDescriptionDirectory API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 20,     // location of system's PPDs directory (Library/Printers/PPDs)
 | 
			
		||||
    NSSharedPublicDirectory API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 21,           // location of user's Public sharing directory (~/Public)
 | 
			
		||||
    NSPreferencePanesDirectory API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 22,        // location of the PreferencePanes directory for use with System Preferences (Library/PreferencePanes)
 | 
			
		||||
    NSApplicationScriptsDirectory API_AVAILABLE(macos(10.8)) API_UNAVAILABLE(ios, watchos, tvos) = 23,      // location of the user scripts folder for the calling application (~/Library/Application Scripts/code-signing-id)
 | 
			
		||||
    NSItemReplacementDirectory API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0)) = 99,	    // For use with NSFileManager's URLForDirectory:inDomain:appropriateForURL:create:error:
 | 
			
		||||
    NSAllApplicationsDirectory = 100,       // all directories where applications can occur
 | 
			
		||||
    NSAllLibrariesDirectory = 101,          // all directories where resources can occur
 | 
			
		||||
    NSTrashDirectory API_AVAILABLE(macos(10.8), ios(11.0)) API_UNAVAILABLE(watchos, tvos) = 102             // location of Trash directory
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSSearchPathDomainMask) {
 | 
			
		||||
    NSUserDomainMask = 1,       // user's home directory --- place to install user's personal items (~)
 | 
			
		||||
    NSLocalDomainMask = 2,      // local to the current machine --- place to install items available to everyone on this machine (/Library)
 | 
			
		||||
    NSNetworkDomainMask = 4,    // publically available location in the local area network --- place to install items available on the network (/Network)
 | 
			
		||||
    NSSystemDomainMask = 8,     // provided by Apple, unmodifiable (/System)
 | 
			
		||||
    NSAllDomainsMask = 0x0ffff  // all domains: all of the above and future items
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
FOUNDATION_EXPORT NSArray<NSString *> *NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, BOOL expandTilde);
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,43 @@
 | 
			
		||||
/*	NSPersonNameComponents.h
 | 
			
		||||
	Copyright (c) 2015-2019, Apple Inc. All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0))
 | 
			
		||||
@interface NSPersonNameComponents : NSObject <NSCopying, NSSecureCoding>{
 | 
			
		||||
@private
 | 
			
		||||
    id _private;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* The below examples all assume the full name Dr. Johnathan Maple Appleseed Esq., nickname "Johnny" */
 | 
			
		||||
 | 
			
		||||
/* Pre-nominal letters denoting title, salutation, or honorific, e.g. Dr., Mr. */
 | 
			
		||||
@property (copy, nullable) NSString *namePrefix;
 | 
			
		||||
 | 
			
		||||
/* Name bestowed upon an individual by one's parents, e.g. Johnathan */
 | 
			
		||||
@property (copy, nullable) NSString *givenName;
 | 
			
		||||
 | 
			
		||||
/* Secondary given name chosen to differentiate those with the same first name, e.g. Maple  */
 | 
			
		||||
@property (copy, nullable) NSString *middleName;
 | 
			
		||||
 | 
			
		||||
/* Name passed from one generation to another to indicate lineage, e.g. Appleseed  */
 | 
			
		||||
@property (copy, nullable) NSString *familyName;
 | 
			
		||||
 | 
			
		||||
/* Post-nominal letters denoting degree, accreditation, or other honor, e.g. Esq., Jr., Ph.D. */
 | 
			
		||||
@property (copy, nullable) NSString *nameSuffix;
 | 
			
		||||
 | 
			
		||||
/* Name substituted for the purposes of familiarity, e.g. "Johnny"*/
 | 
			
		||||
@property (copy, nullable) NSString *nickname;
 | 
			
		||||
 | 
			
		||||
/* Each element of the phoneticRepresentation should correspond to an element of the original PersonNameComponents instance.
 | 
			
		||||
   The phoneticRepresentation of the phoneticRepresentation object itself will be ignored. nil by default, must be instantiated.
 | 
			
		||||
*/
 | 
			
		||||
@property (copy, nullable) NSPersonNameComponents *phoneticRepresentation;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user