Skip to content

Foundation iOS xcode16.0 b1

Rolf Bjarne Kvinge edited this page Aug 19, 2024 · 4 revisions

#Foundation.framework https://github.com/xamarin/xamarin-macios/pull/21065

diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h --- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h	2024-04-19 07:59:24 +++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h	2024-05-30 03:40:42 @@ -337,6 +337,10 @@ NS_SWIFT_NAME(inflectionAlternative) API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)); +FOUNDATION_EXPORT NSAttributedStringKey const NSLocalizedNumberFormatAttributeName + NS_SWIFT_NAME(localizedNumberFormat) + API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0)); + FOUNDATION_EXTERN const NSAttributedStringKey NSPresentationIntentAttributeName API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0)); diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h --- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h	2024-04-05 22:35:31 +++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h	2024-05-30 04:24:42 @@ -55,6 +55,7 @@ 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), + NSCalendarUnitDayOfYear API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0)) = kCFCalendarUnitDayOfYear, 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), #if !0 @@ -426,6 +427,7 @@ @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 NSInteger dayOfYear API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.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)); diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueSharedObservers.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueSharedObservers.h --- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueSharedObservers.h	1970-01-01 01:00:00 +++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyValueSharedObservers.h	2024-05-30 10:19:16 @@ -0,0 +1,77 @@ +// +// NSKeyValueSharedObservers.h +// Foundation +// +// Copyright (c) 2024, Apple Inc. +// All rights reserved. +// + +#import <Foundation/NSKeyValueObserving.h> + +NS_HEADER_AUDIT_BEGIN(nullability, sendability) + +/// A collection of key-value observations which may be registered with multiple +/// observable objects. Create using ``-[NSKeyValueSharedObservers snapshot]`` +API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0), visionos(2.0)) +@interface NSKeyValueSharedObserversSnapshot: NSObject +- (id)init NS_UNAVAILABLE; ++ (id)new NS_UNAVAILABLE; +@end + +/// A collection of key-value observations which may be registered with multiple +/// observable objects +API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0), visionos(2.0)) +@interface NSKeyValueSharedObservers: NSObject +/// A new collection of observables for an observable object of the given class +- (id)initWithObservableClass:(Class)observableClass; +- (id)init NS_UNAVAILABLE; ++ (id)new NS_UNAVAILABLE; + +/// Add a new observer to the collection. +/// +/// This method works like `-[NSObject addObserver: forKey: options: context:]`, +/// but observations on nested and computed properties are disallowed. Observers +/// are not registered until `setSharedObservers` is called on the observable. +/// +/// - Parameter observer: The observer object to register for KVO notifications. +/// The observer must implement the key-value observing method ``observeValue: +/// forKeyPath: of: change: context:`` +/// - Parameter key: key of the property being observed. This cannot be a nested +/// key path or a computed property +/// - Parameter options: A combination of NSKeyValueObservingOptions values that +/// specify what is included in observation notifications. For possible values +/// see NSKeyValueObservingOptions. +/// - Parameter context: Arbitrary data which is passed to the observer object +- (void)addSharedObserver:(NSObject *)observer + forKey:(NSString *)key + options:(NSKeyValueObservingOptions)options + context:(nullable void *)context; + +- (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(nullable void *)context NS_UNAVAILABLE; + +/// A momentary snapshot of all observers added to the collection thus far, that +/// can be assigned to an observable using ``-[NSObject setSharedObservers:]`` +- (NSKeyValueSharedObserversSnapshot *)snapshot; +@end + +@interface NSObject(NSKeyValueSharedObserverRegistration) +/// Register shared observations. +/// +/// A shared observation collection might be shared between multiple observables +/// to minimise registration work. Shared observers remain registered throughout +/// the object's lifetime and do not need to be removed using `removeObserver:`. +/// +/// An observable may only have one set of shared observations. Subsequent calls +/// to this method will replace existing shared observations. +/// +/// - Parameter sharedObservers: shared observer collection that was initialized +/// with the class of this object +/// - Invariant: `sharedObserers` was initialized with the class of this object +/// - Throws: Exception if the class of the receiving observable object does not +/// match the class with which `sharedObserers` was initialized. +- (void)setSharedObservers:(NSKeyValueSharedObserversSnapshot * _Nullable)sharedObservers API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0), visionos(2.0)); + + +@end + +NS_HEADER_AUDIT_END(nullability, sendability) diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLocalizedNumberFormatRule.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLocalizedNumberFormatRule.h --- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLocalizedNumberFormatRule.h	1970-01-01 01:00:00 +++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSLocalizedNumberFormatRule.h	2024-05-30 10:19:16 @@ -0,0 +1,25 @@ +// +// NSLocalizedNumberFormatRule.h +// Foundation +// +// Copyright (c) 2024, Apple Inc. +// All rights reserved. +// + +#import <Foundation/Foundation.h> + +NS_HEADER_AUDIT_BEGIN(nullability, sendability) + +API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0)) +NS_REFINED_FOR_SWIFT +@interface NSLocalizedNumberFormatRule : NSObject <NSCopying, NSSecureCoding> + ++ (id)new NS_UNAVAILABLE; +- (id)init NS_UNAVAILABLE; + ++ (NSLocalizedNumberFormatRule *)automatic; + +@end + +NS_HEADER_AUDIT_END(nullability, sendability) + diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNumberFormatter.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNumberFormatter.h --- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNumberFormatter.h	2024-04-19 08:01:25 +++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSNumberFormatter.h	2024-05-30 05:00:49 @@ -54,6 +54,8 @@ + (NSNumberFormatterBehavior)defaultFormatterBehavior; + (void)setDefaultFormatterBehavior:(NSNumberFormatterBehavior)behavior; +// See `kCFNumberFormatterMinGroupingDigits` in `CFNumberFormatter` for an explanation on how minimum grouping digits is used. +@property NSInteger minimumGroupingDigits API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0)); @property NSNumberFormatterStyle numberStyle; @property (null_resettable, copy) NSLocale *locale; @property BOOL generatesDecimalNumbers; diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSStream.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSStream.h --- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSStream.h	2024-04-19 07:31:40 +++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSStream.h	2024-05-30 04:48:40 @@ -38,7 +38,7 @@ - (void)open; - (void)close; -@property (nullable, assign) id <NSStreamDelegate> delegate; +@property (nullable, assign /* actually weak */) id <NSStreamDelegate> delegate; // By default, a stream is its own delegate, and subclassers of NSInputStream and NSOutputStream must maintain this contract. [someStream setDelegate:nil] must restore this behavior. As usual, delegates are not retained. - (nullable id)propertyForKey:(NSStreamPropertyKey)key; diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h --- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h	2024-04-19 07:31:42 +++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h	2024-05-30 04:24:46 @@ -505,11 +505,7 @@ NS_SWIFT_SENDABLE // Immutable with no mutable subclasses API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0)) // NSURLQueryItem encapsulates a single query name-value pair. The name and value strings of a query name-value pair are not percent encoded. For use with the NSURLComponents queryItems property. -@interface NSURLQueryItem : NSObject <NSSecureCoding, NSCopying> { -@private - NSString *_name; - NSString *_value; -} +@interface NSURLQueryItem : NSObject <NSSecureCoding, NSCopying>  - (instancetype)initWithName:(NSString *)name value:(nullable NSString *)value NS_DESIGNATED_INITIALIZER; + (instancetype)queryItemWithName:(NSString *)name value:(nullable NSString *)value; @property (readonly) NSString *name; diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLRequest.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLRequest.h --- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLRequest.h	2024-04-19 08:01:25 +++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLRequest.h	2024-05-30 10:19:15 @@ -357,6 +357,15 @@ */ @property (readonly) BOOL requiresDNSSECValidation API_AVAILABLE(macos(13.0), ios(16.1), watchos(9.1), tvos(16.1)); +/*! + @abstract Allows storing and usage of DNS answers, potentially beyond TTL expiry, + in a persistent per-process cache. This should only be set for hostnames whose resolutions + are not expected to change across networks. + @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, + NO otherwise. Defaults to NO. + */ +@property (readonly) BOOL allowsPersistentDNS API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0)); + @end @@ -482,6 +491,15 @@ No otherwise. Defaults to NO. */ @property BOOL requiresDNSSECValidation API_AVAILABLE(macos(13.0), ios(16.1), watchos(9.1), tvos(16.1)); + +/*! + @abstract Allows storing and usage of DNS answers, potentially beyond TTL expiry, + in a persistent per-process cache. This should only be set for hostnames whose resolutions + are not expected to change across networks. + @discussion YES, if the DNS lookup for this request is allowed to use a persistent per-process cache, + NO otherwise. Defaults to NO. + */ +@property BOOL allowsPersistentDNS API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0), visionos(2.0)); @end diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h --- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h	2024-04-19 07:18:53 +++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSUndoManager.h	2024-05-30 04:48:41 @@ -20,6 +20,9 @@ // used with NSRunLoop's performSelector:target:argument:order:modes: static const NSUInteger NSUndoCloseGroupingRunLoopOrdering = 350000; +/// A key used to set and get user info for undo and redo actions +typedef NSString * NSUndoManagerUserInfoKey NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(UndoManager.UserInfoKey) API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); + API_AVAILABLE(macos(10.0), ios(3.0), watchos(2.0), tvos(9.0)) @interface NSUndoManager : NSObject @@ -198,6 +201,21 @@ /// /// - Parameter actionName: The name of the action. - (void)setActionName:(NSString *)actionName; + +/// Get a value from the undo action's user info +/// +/// - Parameter key: Which value should be retrieved +-(id _Nullable)undoActionUserInfoValueForKey:(NSUndoManagerUserInfoKey)key API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); + +/// Get a value from the redo action's user info +///  +/// - Parameter key: Which value should be retrieved +-(id _Nullable)redoActionUserInfoValueForKey:(NSUndoManagerUserInfoKey)key API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); + +/// Set user info for the Undo or Redo command. +/// - Parameter info: Value to be saved in the user info +/// - Parameter key: Key at which the object should be saved +-(void)setActionUserInfoValue:(id _Nullable)info forKey:(NSUndoManagerUserInfoKey)key API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0)); // Call undoMenuItemTitle or redoMenuItemTitle to get the string for the undo or redo menu item. // In English they will return "Undo <action name>"/"Redo <action name>" or "Undo"/"Redo" if there is 
Clone this wiki locally