Skip to content

BackgroundAssets macOS xcode26.0 b1

Alex Soto edited this page Jun 9, 2025 · 3 revisions

#BackgroundAssets.framework

diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPack.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPack.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPack.h	1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPack.h	2025-05-25 08:13:20
@@ -0,0 +1,51 @@
+//
+//  BAAssetPack.h
+//  Background Assets
+//
+//  Created by Gabriel Jacoby-Cooper on 3/10/25.
+//
+
+NS_HEADER_AUDIT_BEGIN(nullability, sendability)
+
+/// An archive of assets that the system downloads together.
+///
+/// An instance of this class can be invalidated when the asset pack that it represents is updated on the server.
+API_AVAILABLE(ios(26.0), macos(26.0), tvos(26.0), visionos(26.0))
+API_UNAVAILABLE(watchos)
+NS_SWIFT_SENDABLE
+NS_REFINED_FOR_SWIFT
+@interface BAAssetPack : NSObject
+
+/// A unique identifier for the asset pack.
+@property (readonly, copy) NSString* identifier NS_SWIFT_NAME(id);
+
+/// The size of the download file containing the asset pack in bytes.
+///
+/// This is different than the installation size, which could be larger.
+@property (readonly, assign) NSInteger downloadSize;
+
+/// The asset pack’s version number
+@property (readonly, assign) NSInteger version;
+
+/// JSON-encoded custom information that’s associated with the asset pack.
+///
+/// This property is `nil` for Apple-hosted asset packs.
+@property (nullable, readonly, copy) NSData* userInfo;
+
+- (null_unspecified instancetype)init NS_UNAVAILABLE;
+
++ (null_unspecified instancetype)new NS_UNAVAILABLE;
+
+/// Creates a download object for the asset pack that you schedule using a download manager.
+/// - Remark: Use this method in your main app; use ``BAAssetPack/downloadForContentRequest:`` instead in your downloader extension.
+- (BADownload*)download;
+
+/// Creates a download object for the asset pack that you schedule using a download manager.
+/// - Parameter contentRequest: The content request for the current extension invocation.
+/// - Returns: A download object.
+/// - Remark: Use this method in your downloader extension; use ``BAAssetPack/download`` instead in your main app.
+- (BADownload*)downloadForContentRequest:(BAContentRequest)contentRequest;
+
+@end
+
+NS_HEADER_AUDIT_END(nullability, sendability)
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackManager.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackManager.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackManager.h	1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackManager.h	2025-05-25 02:18:23
@@ -0,0 +1,124 @@
+//
+//  BAAssetPackManager.h
+//  Background Assets
+//
+//  Created by Gabriel Jacoby-Cooper on 3/10/25.
+//
+
+#import <BackgroundAssets/BAAssetPackStatus.h>
+#import <BackgroundAssets/BAManagedAssetPackDownloadDelegate.h>
+
+NS_HEADER_AUDIT_BEGIN(nullability, sendability)
+
+/// A class that manages asset packs.
+///
+/// The first time that your code refers to the shared manager, Background Assets considers that your app is opting into automatic system management of your asset packs.
+/// - Important: When using the asset-pack manager, make sure that you also adopt the corresponding managed extension protocol. For apps that use Apple hosting, the corresponding protocol is `SKDownloaderExtension` from StoreKit. For other apps, the corresponding protocol is ``BAManagedDownloaderExtension``. Not adopting the right protocol is a programmer error.
+API_AVAILABLE(ios(26.0), macos(26.0), tvos(26.0), visionos(26.0))
+API_UNAVAILABLE(watchos)
+NS_REFINED_FOR_SWIFT
+@interface BAAssetPackManager : NSObject
+
+/// The shared asset-pack manager.
+@property (class, readonly, strong) BAAssetPackManager* sharedManager NS_SWIFT_NAME(shared);
+
+/// An object that receives notifications about events that occur as an asset pack is downloaded.
+@property (nullable, readwrite, weak) id<BAManagedAssetPackDownloadDelegate> delegate;
+
+- (null_unspecified instancetype)init NS_UNAVAILABLE;
+
++ (null_unspecified instancetype)new NS_UNAVAILABLE;
+
+/// Gets the asset packs that are available to download.
+///
+/// This method might attempt to get the latest asset-pack information from the server.
+/// - Parameter completionHandler: A block that receives the asset packs or an error if one occurs.
+- (void)getAllAssetPacksWithCompletionHandler:(void (^)(NSSet<BAAssetPack*>* _Nullable assetPacks, NSError* _Nullable error))completionHandler
+NS_SWIFT_ASYNC_NAME(allAssetPacks());
+
+/// Gets the asset pack with the specified identifier.
+///
+/// If no asset pack with the specified identifier is found, then the block will receive an `NSError` object with ``BAManagedErrorCode/assetPackNotFound`` as its code for the `error` parameter. This method might attempt to get the latest asset-pack information from the server.
+/// - Parameters:
+///   - assetPackIdentifier: The asset pack’s identifier.
+///   - completionHandler: A block that receives the asset pack or an error if one occurs.
+- (void)getAssetPackWithIdentifier:(NSString*)assetPackIdentifier
+                 completionHandler:(void (^)(BAAssetPack* _Nullable assetPack, NSError* _Nullable error))completionHandler
+NS_SWIFT_ASYNC_NAME(assetPack(withID:));
+
+/// Gets the status of the asset pack with the specified identifier.
+///
+/// If no asset pack with the specified identifier is found, then the block will receive an `NSError` object with ``BAManagedErrorCode/assetPackNotFound`` as its code for the `error` parameter. This method attempts to get the latest asset-pack information from the server. No updates or removals are automatically triggered.
+/// - Parameters:
+///   - assetPackIdentifier: The asset pack’s identifier.
+///   - completionHandler: A block that receives the status of the asset pack or an error if one occurs.
+- (void)getStatusOfAssetPackWithIdentifier:(NSString*)assetPackIdentifier
+                         completionHandler:(void (^)(BAAssetPackStatus status, NSError* _Nullable error))completionHandler
+NS_SWIFT_ASYNC_NAME(status(ofAssetPackWithID:));
+
+/// Ensures that the specified asset pack be available locally.
+///
+/// This method checks if the asset pack is currently downloaded. If it isn’t, then it schedules it to be downloaded and calls the block with `nil` for the block’s `error` parameter when the download completes. It’s guaranteed that the requested asset pack will be available locally once the block is called with `nil` for its `error` parameter. If a non-`nil` value is provided to the block’s `error` parameter, then the asset pack is **not** guaranteed to be available locally. You can optionally monitor download progress by attaching a delegate object to `delegate`.
+/// - Parameters:
+///   - assetPack: The asset pack the local availability of which to ensure.
+///   - completionHandler: A block that’s called when the asset pack is available locally or that receives an error if one occurs.
+- (void)ensureLocalAvailabilityOfAssetPack:(BAAssetPack*)assetPack
+                         completionHandler:(void (^)(NSError* _Nullable error))completionHandler;
+
+/// Gets the latest asset-pack information from the server, updates outdated asset packs, and removes obsolete asset packs.
+/// - Parameter completionHandler: A block that receives a set of identifiers of asset packs that are being updated and a set of identifiers of removed asset packs or an error if one occurs.
+- (void)checkForUpdatesWithCompletionHandler:(nullable void (^)(NSSet<NSString*>* _Nullable updatingIdentifiers, NSSet<NSString*>* _Nullable removedIdentifiers, NSError* _Nullable error))completionHandler;
+
+/// Gets the contents of a file at the specified relative file path.
+///
+/// All asset packs share the same namespace, so you can treat the overall collection of downloaded asset packs as if it were a single root directory that contains all of your subdirectories and asset files, regardless of the specific asset pack in which any particular file resides. If there’s a file-path collision across multiple asset packs, then it’s undefined from which asset pack the file will be read unless you explicitly limit the search to a particular asset pack by passing a non-`nil` identifier to the `assetPackIdentifier` parameter.
+/// - Parameters:
+///   - path: The relative file path.
+///   - assetPackIdentifier: The identifier of the asset pack in which you want to search for the file or `nil` if you want to search in all asset packs.
+///   - options: Options for how to read the contents of the file into a data object.
+///   - error: A pointer to an error that will be set if an error occurs. If no file is found at `path`, then `error` will point to an `NSError` object with ``BAManagedErrorCode/fileNotFound`` as its code.
+/// - Returns: The file’s contents.
+- (nullable NSData*)contentsAtPath:(NSString*)path
+searchingInAssetPackWithIdentifier:(nullable NSString*)assetPackIdentifier
+                           options:(NSDataReadingOptions)options
+                             error:(NSError* _Nullable *)error
+NS_SWIFT_NAME(contents(atPath:searchingInAssetPackWithID:options:));
+
+/// Opens a file descriptor for the specified relative file path.
+///
+/// All asset packs share the same namespace, so you can treat the overall collection of downloaded asset packs as if it were a single root directory that contains all of your subdirectories and asset files, regardless of the specific asset pack in which any particular file resides. If there’s a file-path collision across multiple asset packs, then it’s undefined from which asset pack the file will be opened unless you explicitly limit the search to a particular asset pack by passing a non-`nil` identifier to the `assetPackIdentifier` parameter. A return value of `-1` indicates that an error occurred.
+/// - Parameters:
+///   - path: The relative file path.
+///   - assetPackIdentifier: The identifier of the asset pack in which you want to search for the file or `nil` if you want to search in all asset packs.
+///   - error: A pointer to an error that will be set if an error occurs. If no file is found at `path`, then it will point to an `NSError` object with ``BAManagedErrorCode/fileNotFound`` as its code.
+/// - Returns: A descriptor for the opened file.
+/// - Important: It’s your responsibility to close the file descriptor when you’re done using it.
+/// - Remark: Use this method if you need low-level access to the file descriptor. If you don’t, then use ``BAAssetPackManager/contentsAtPath:searchingInAssetPackWithIdentifier:options:error:`` instead.
+- (signed int)fileDescriptorForPath:(NSString*)path
+ searchingInAssetPackWithIdentifier:(nullable NSString*)assetPackIdentifier
+                              error:(NSError* _Nullable *)error
+NS_SWIFT_NAME(descriptor(forPath:searchingInAssetPackWithID:error:));
+
+/// Gets the URL for the specified relative file path.
+///
+/// All asset packs share the same namespace, so you can treat the overall collection of downloaded asset packs as if it were a single root directory that contains all of your subdirectories and asset files, regardless of the specific asset pack in which any particular file resides. Unlike ``BAAssetPackManager/contentsAtPath:searchingInAssetPackWithIdentifier:options:error:`` and ``BAAssetPackManager/fileDescriptorForPath:searchingInAssetPackWithIdentifier:error:``, this method supports retrieving entire directories—including packages—in which case it merges the corresponding slices of the shared logical directory from all downloaded asset packs that contain such slices. If there’s a file-path collision across multiple asset packs, then it’s undefined from which asset pack an individual file will be resolved.
+/// - Parameters:
+///   - path: The relative file path.
+///   - error: A pointer to an error that will be set if an error occurs.
+/// - Warning: Don’t persist the returned URL beyond the lifetime of the current process.
+/// - Warning: This method is less efficient than are ``BAAssetPackManager/contentsAtPath:searchingInAssetPackWithIdentifier:options:error:`` and ``BAAssetPackManager/fileDescriptorForPath:searchingInAssetPackWithIdentifier:error:``; use those methods instead if you can do so. In particular, this method shouldn’t be used to get the URL to the root of the shared asset-pack namespace. Don’t use this method to block the main thread.
+/// - Note: This method will return a well formed URL even if no item exists at the specified relative path in any asset pack, in which case any attempts to get its contents—whether it’s a file or a directory—will fail.
+- (nullable NSURL*)URLForPath:(NSString*)path error:(NSError* _Nullable *)error
+NS_SWIFT_NAME(url(forPath:));
+
+/// Removes the downloaded asset pack with the specified identifier.
+/// - Parameters:
+///   - assetPackIdentifier: The identifier of the asset pack to remove.
+///   - completionHandler: A block that receives an error if one occurs.
+- (void)removeAssetPackWithIdentifier:(NSString*)assetPackIdentifier
+                    completionHandler:(nullable void (^)(NSError* _Nullable error))completionHandler
+NS_SWIFT_ASYNC_NAME(remove(assetPackWithID:));
+
+@end
+
+NS_HEADER_AUDIT_END(nullability, sendability)
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackManifest.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackManifest.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackManifest.h	1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackManifest.h	2025-05-25 08:13:20
@@ -0,0 +1,65 @@
+//
+//  BAAssetPackManifest.h
+//  Background Assets
+//
+//  Created by Gabriel Jacoby-Cooper on 3/10/25.
+//
+
+#import <BackgroundAssets/BAAssetPack.h>
+
+NS_HEADER_AUDIT_BEGIN(nullability, sendability)
+
+/// A representation of a manifest that lists asset packs that are available to download.
+///
+/// This class applies only when you want to manage your asset packs manually. Don’t use this class if you want to opt in to automatic management of asset packs.
+API_AVAILABLE(ios(26.0), macos(26.0), tvos(26.0), visionos(26.0))
+API_UNAVAILABLE(watchos)
+NS_SWIFT_SENDABLE
+NS_REFINED_FOR_SWIFT
+@interface BAAssetPackManifest : NSObject
+
+/// The asset packs that are available to download.
+@property (readonly, copy) NSSet<BAAssetPack*>* assetPacks;
+
+- (null_unspecified instancetype)init NS_UNAVAILABLE;
+
+/// Initializes a representation of a manifest in memory given a URL to the manifest’s representation as a JSON file on disk.
+/// - Parameters:
+///   - URL: A URL to a local JSON file.
+///   - applicationGroupIdentifier: The identifier of the application group in which to store unmanaged asset packs that are downloaded from the manifest.
+///   - error: A pointer to an error that will be set if an error occurs.
+- (nullable instancetype)initWithContentsOfURL:(NSURL*)URL
+                    applicationGroupIdentifier:(NSString*)applicationGroupIdentifier
+                                         error:(NSError* _Nullable * _Nullable)error
+NS_SWIFT_NAME(init(contentsOf:appGroupID:));
+
+/// Initializes a representation of a manifest in memory from JSON-encoded data.
+/// - Parameters:
+///   - data: JSON-encoded data.
+///   - applicationGroupIdentifier: The identifier of the application group in which to store unmanaged asset packs that are downloaded from the manifest.
+///   - error: A pointer to an error that will be set if an error occurs.
+- (nullable instancetype)initFromData:(NSData*)data
+           applicationGroupIdentifier:(NSString*)applicationGroupIdentifier
+                                error:(NSError* _Nullable * _Nullable)error
+NS_SWIFT_NAME(init(from:appGroupID:));
+
++ (null_unspecified instancetype)new NS_UNAVAILABLE;
+
+/// Creates download objects for every asset pack in this manifest.
+///
+/// The returned download objects can be scheduled with the download manager.
+/// - Returns: A collection of download objects.
+/// - Remark: Use this method in your main app; use `-allDownloadsForContentRequest:` in your downloader extension.
+- (NSSet<BADownload*>*)allDownloads;
+
+/// Creates download objects for every asset pack in this manifest.
+///
+/// The returned download objects can be scheduled with the download manager.
+/// - Parameter contentRequest: The content request for the current extension invocation.
+/// - Returns: A collection of download objects.
+/// - Remark: Use this method in your downloader extension; use `-allDownloads` instead in your main app.
+- (NSSet<BADownload*>*)allDownloadsForContentRequest:(BAContentRequest)contentRequest;
+
+@end
+
+NS_HEADER_AUDIT_END(nullability, sendability)
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackStatus.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackStatus.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackStatus.h	1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAAssetPackStatus.h	2025-05-25 08:13:21
@@ -0,0 +1,39 @@
+//
+//  BAAssetPackStatus.h
+//  Background Assets
+//
+//  Created by Gabriel Jacoby-Cooper on 3/10/25.
+//
+
+/// The status of an asset pack.
+API_AVAILABLE(ios(26.0), macos(26.0), tvos(26.0), visionos(26.0))
+API_UNAVAILABLE(watchos)
+NS_REFINED_FOR_SWIFT
+typedef NS_OPTIONS(NSUInteger, BAAssetPackStatus) {
+    
+    /// A status value that indicates that the asset pack is available to download.
+    BAAssetPackStatusDownloadAvailable = 1 << 0,
+    
+    /// A status value that indicates that an update to the asset pack is available to download.
+    BAAssetPackStatusUpdateAvailable = 1 << 1,
+    
+    /// A status value that indicates that the downloaded asset pack is up to date.
+    BAAssetPackStatusUpToDate = 1 << 2,
+    
+    /// A status value that indicates that the downloaded asset pack is out of date.
+    ///
+    /// The presence of this status value doesn’t necessarily imply that an update to the asset pack can be downloaded over the current network connection. Check for the presence of ``BAAssetPackStatus/updateAvailable`` to determine whether an update can currently be downloaded.
+    BAAssetPackStatusOutOfDate = 1 << 3,
+    
+    /// A status value that indicates that the asset pack is no longer available to download.
+    ///
+    /// Obsolete asset packs can’t be updated, and they also can’t be redownloaded once removed.
+    BAAssetPackStatusObsolete = 1 << 4,
+    
+    /// A status value that indicates that the system is currently downloading the asset pack.
+    BAAssetPackStatusDownloading = 1 << 5,
+    
+    /// A status value that indicates that the system finished downloading the asset pack.
+    BAAssetPackStatusDownloaded = 1 << 6
+    
+};
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedAssetPackDownloadDelegate.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedAssetPackDownloadDelegate.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedAssetPackDownloadDelegate.h	1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedAssetPackDownloadDelegate.h	2025-05-25 08:13:20
@@ -0,0 +1,49 @@
+//
+//  BAManagedAssetPackDownloadDelegate.h
+//  Background Assets
+//
+//  Created by Gabriel Jacoby-Cooper on 3/10/25.
+//
+
+#import <BackgroundAssets/BAAssetPack.h>
+
+NS_HEADER_AUDIT_BEGIN(nullability, sendability)
+
+/// A type that can receive notifications about events that occur as an asset pack is downloaded.
+API_AVAILABLE(ios(26.0), macos(26.0), tvos(26.0), visionos(26.0))
+API_UNAVAILABLE(watchos)
+NS_SWIFT_SENDABLE
+NS_REFINED_FOR_SWIFT
+@protocol BAManagedAssetPackDownloadDelegate <NSObject>
+
+@optional
+
+/// Notifies the receiver that an asset pack began or resumed being downloaded.
+/// - Parameter assetPack: The asset pack.
+- (void)downloadOfAssetPackBegan:(BAAssetPack*)assetPack;
+
+/// Notifies the receiver that an asset pack is currently being downloaded.
+/// - Parameters:
+///   - assetPack: The asset pack.
+///   - progress: The download progress.
+- (void)downloadOfAssetPack:(BAAssetPack*)assetPack
+                hasProgress:(NSProgress*)progress;
+
+/// Notifies the receiver that an asset pack paused being downloaded.
+/// - Parameter assetPack: The asset pack.
+- (void)downloadOfAssetPackPaused:(BAAssetPack*)assetPack;
+
+/// Notifies the receiver that an asset pack is now available locally.
+/// - Parameter assetPack: The asset pack.
+- (void)downloadOfAssetPackFinished:(BAAssetPack*)assetPack;
+
+/// Notifies the receiver that an asset pack failed to be downloaded.
+/// - Parameters:
+///   - assetPack: The asset pack.
+///   - error: The error that occured.
+- (void)downloadOfAssetPack:(BAAssetPack*)assetPack
+            failedWithError:(NSError*)error;
+
+@end
+
+NS_HEADER_AUDIT_END(nullability, sendability)
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedDownloaderExtension.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedDownloaderExtension.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedDownloaderExtension.h	1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedDownloaderExtension.h	2025-05-25 08:13:20
@@ -0,0 +1,70 @@
+//
+//  BAManagedDownloaderExtension.h
+//  Background Assets
+//
+//  Created by Gabriel Jacoby-Cooper on 3/10/25.
+//
+
+#import <BackgroundAssets/BADownloadManager.h>
+
+/// A protocol to which a manged downloader extension must conform.
+///
+/// The protocol provides default implementations for all of the inherited `BADownloaderExtension` requirements.
+/// - Warning: Don’t implement any of the inherited `BADownloaderExtension` requirements aside from, optionally, `-backgroundDownload:didReceiveChallenge:completionHandler:`.
+///
+/// ## Adding an Objective-C Downloader Extension
+/// Xcode’s Background Download extension template generates Swift code when you select either the “Apple-hosted” or the “Self-hosted” option, but you can easily switch to Objective-C instead if you prefer. To do so, follow these steps:
+/// 1. Remove `DownloaderExtension.swift`.
+/// 2. Create `DownloaderExtension.h` with the following contents:
+///   ### Apple Hosting
+///   ```objc
+///   #import <BackgroundAssets/BackgroundAssets.h>
+///
+///   \@interface DownloaderExtension : NSObject <BAManagedDownloaderExtension>
+///
+///   @end
+///   ```
+///
+///   ### Self-hosting
+///   ```objc
+///   #import <StoreKit/StoreKit.h>
+///
+///   \@interface DownloaderExtension : NSObject <SKDownloaderExtension>
+///
+///   @end
+///   ```
+///   (Remove any backslash characters that may be rendered in the above code snippets.)
+///
+/// 3. Create `DownloaderExtension.m` with the following contents:
+///   ```objc
+///   #import "DownloaderExtension.h"
+///
+///   @implementation DownloaderExtension
+///
+///   - (BOOL)shouldDownloadAssetPack:(BAAssetPack *)assetPack {
+///       // Use this method to filter out asset packs that the system would otherwise download automatically. You can also remove this method entirely if you just want to rely on the default download behavior.
+///       return true;
+///   }
+///
+///   @end
+///   ```
+/// 4. Add `DownloaderExtension.m` to your extension’s target.
+/// 5. Add the following snippet inside your extension’s `Info.plist`’s `EXAppExtensionAttributes` dictionary:
+///   ```plist
+///   <key>EXPrincipalClass</key>
+///   <string>DownloaderExtension</string>
+///   ```
+API_AVAILABLE(ios(26.0), macos(26.0), tvos(26.0), visionos(26.0))
+API_UNAVAILABLE(watchos)
+NS_REFINED_FOR_SWIFT
+@protocol BAManagedDownloaderExtension <BADownloaderExtension>
+
+@optional
+/// Determines whether a particular asset pack should be downloaded.
+///
+/// By default, the system automatically downloads all applicable asset packs with either “essential” or “prefetch” download policies for the current installation event type. You can optionally implement this method to filter out unwanted asset packs at runtime.
+/// - Parameter assetPack: An asset pack that’s being considered as a candidate to be downloaded.
+/// - Returns: Whether the asset pack should be downloaded.
+- (BOOL)shouldDownloadAssetPack:(nonnull BAAssetPack*)assetPack;
+
+@end
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedError.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedError.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedError.h	1969-12-31 19:00:00
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BAManagedError.h	2025-05-25 08:13:20
@@ -0,0 +1,35 @@
+//
+//  BAManagedError.h
+//  Background Assets
+//
+//  Created by Gabriel Jacoby-Cooper on 4/14/25.
+//
+
+#import <BackgroundAssets/BackgroundAssets.h>
+#import <Foundation/Foundation.h>
+
+NS_HEADER_AUDIT_BEGIN(nullability, sendability)
+
+/// The Managed Background Assets error domain.
+BA_EXPORT NSErrorDomain const BAManagedErrorDomain API_AVAILABLE(ios(26.0), macos(26.0), tvos(26.0), visionos(26.0)) API_UNAVAILABLE(watchos) NS_REFINED_FOR_SWIFT;
+
+/// The `-[NSError userInfo]` key for an asset pack’s identifier.
+///
+/// This key is relevant when the error code is ``BAManagedErrorCode/assetPackNotFound``.
+BA_EXPORT NSErrorUserInfoKey const BAAssetPackIdentifierErrorKey API_AVAILABLE(ios(26.0), macos(26.0), tvos(26.0), visionos(26.0)) API_UNAVAILABLE(watchos) NS_REFINED_FOR_SWIFT;
+
+/// A Managed Background Assets error code.
+typedef NS_ENUM(NSInteger, BAManagedErrorCode) {
+    
+    /// An error code that indicates that an asset pack wasn’t found.
+    ///
+    /// Refer to the value in `-[NSError userInfo]` for the key `BAAssetPackIdentifierErrorKey` for the asset pack’s identifier.
+    BAManagedErrorCodeAssetPackNotFound,
+    
+    /// An error code that indicates that a file wasn’t found.
+    ///
+    /// Refer to the value in `-[NSError userInfo]` for the key `NSFilePathErrorKey` for the file path.
+    BAManagedErrorCodeFileNotFound
+} API_AVAILABLE(ios(26.0), macos(26.0), tvos(26.0), visionos(26.0)) API_UNAVAILABLE(watchos) NS_REFINED_FOR_SWIFT;
+
+NS_HEADER_AUDIT_END(nullability, sendability)
diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.h
--- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.h	2025-05-03 22:05:16
+++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/BackgroundAssets.framework/Headers/BackgroundAssets.h	2025-05-25 08:13:20
@@ -16,3 +16,13 @@
 #import <BackgroundAssets/BADownloadManager.h>
 #import <BackgroundAssets/BAURLDownload.h>
 #import <BackgroundAssets/BAError.h>
+
+// MARK: - Managed Background Assets
+
+#import <BackgroundAssets/BAAssetPack.h>
+#import <BackgroundAssets/BAAssetPackManager.h>
+#import <BackgroundAssets/BAAssetPackManifest.h>
+#import <BackgroundAssets/BAAssetPackStatus.h>
+#import <BackgroundAssets/BAManagedAssetPackDownloadDelegate.h>
+#import <BackgroundAssets/BAManagedDownloaderExtension.h>
+#import <BackgroundAssets/BAManagedError.h>

Clone this wiki locally