What's New / App Services, Foundation & Diagnostics

What's new in Foundation

~9 Deprecated−1 RemovediOS · macOS · tvOS · watchOS · visionOS

Foundation provides base types and services for Apple platform code, including value types like Data, resource loading through Bundle, and notification delivery through NSNotification.

No new symbols this release. Nine APIs are deprecated: Bundle.setPreservationPriority, Bundle.preservationPriority, the NSNotification.Name.NSBundleResourceRequestLowDiskSpace notification name, the NSBundleResourceRequestLoadingPriorityUrgent constant, an init, and registerItem. One symbol is removed: Data.InlineData.

Deprecated

9
init

init

DeprecatediOSmacOStvOSvisionOSwatchOS
public init(item: (any NSSecureCoding)?, typeIdentifier: String?)
DeprecatedUse initWithObject: instead.

Creates an item provider with an object, according to the item provider type coercion policy.

Use this method to initialize an item provider for objects in your app. The item provider registers your object with the specified type. Subsequent requests for that same type return the specified item.

Parameters

item
An object containing the data you want to provide. You may specify nil for this parameter and register items and types later.
typeIdentifier
A string that represents the UTI of the item. If item is not nil, this parameter must not be nil.

ReturnsAn item provider for the specified item.

func

loadItem

DeprecatediOSmacOStvOSvisionOSwatchOS
open func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil)
DeprecatedUse loadObjectOfClass:completionHandler: instead.
func

loadItem

DeprecatediOSmacOStvOSvisionOSwatchOS
open func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil) async throws -> any NSSecureCoding
DeprecatedUse loadObjectOfClass:completionHandler: instead.
let

NSBundleResourceRequestLoadingPriorityUrgent

DeprecatediOStvOSvisionOSwatchOS
public let NSBundleResourceRequestLoadingPriorityUrgent: Double
DeprecatedUse Background Assets instead.

A priority that causes a resource request to load as soon as possible.

func

registerItem

DeprecatediOSmacOStvOSvisionOSwatchOS
open func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler)
DeprecatedUse registerObjectOfClass:visibility:loadHandler: instead.

Lazily registers an item, according to the item provider type coercion policy.

Use this method to register blocks that can take the item provider's file or data object and convert it to a specific data format. Your loadHandler block is executed when a client passes the same typeIdentifier string to the loadItemForTypeIdentifier:options:completionHandler: method.

@deprecated Use registerObjectOfClass:visibility:loadHandler: instead.

Parameters

typeIdentifier
A string that represents the desired UTI.
loadHandler
A block capable of returning the data item as the specified type.
func

Bundle.preservationPriority

DeprecatediOStvOSvisionOSwatchOS
open func preservationPriority(forTag tag: String) -> Double
DeprecatedUse Background Assets instead.

Returns the current preservation priority for the specified tag.

@param tag A string specifying the identifier for a group of related resources. @return The preservation priority for the specified @c tag. Possible values are between @c 0.0 and @c 1.0.

func

Bundle.setPreservationPriority

DeprecatediOStvOSvisionOSwatchOS
open func setPreservationPriority(_ priority: Double, forTags tags: Set<String>)
DeprecatedUse Background Assets instead.

A hint to the system of the relative order for purging tagged sets of resources in the bundle.

@param priority A number specifying the relative priority of preserving the resources. Possible values are between @c 0.0 and @c 1.0. The default is @c 0.0. @param tags A set of tag names specifying resources stored in the bundle. Must not be @c nil.

let

NSNotification.Name.NSBundleResourceRequestLowDiskSpace

DeprecatediOStvOSvisionOSwatchOS
public static let NSBundleResourceRequestLowDiskSpace: NSNotification.Name
DeprecatedUse Background Assets instead.

Posted after the system detects that the amount of available disk space is getting low. The notification is posted to the default notification center.

After receiving this notification, the app should release any on-demand resources that are not required. Call endAccessingResources() to release the managed resources. If the app is in the background and the app does not free up enough space, it may be terminated.

Note: This notification may not be the same as low disk space on the system, as applications can have a smaller quota.

func

Scanner.scanDecimal

DeprecatedwatchOS
open func scanDecimal(_ dcm: UnsafeMutablePointer<Decimal>?) -> Bool

Scans for an NSDecimal value, returning a found value by reference.

Invoke this method with NULL as dcm to simply scan past an NSDecimal representation.

Parameters

dcm
Upon return, contains the scanned value.

ReturnsYES if the receiver finds a valid NSDecimal representation, otherwise NO.

Removed

1
extension

Data.InlineData

RemovediOSmacOS
extension Data.InlineData : BitwiseCopyable
RemovedAbsent from the 27 SDK interface. Declaration shown is from the 26 SDK.
Declaration
extension Data.InlineData : BitwiseCopyable {
}

No APIs match your filter.

← More in App Services, Foundation & Diagnostics