-
Notifications
You must be signed in to change notification settings - Fork 549
Photos macOS xcode26.2 b1
Alex Soto edited this page Nov 5, 2025
·
1 revision
#Photos.framework
diff -ruN /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h
--- /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h 2025-10-16 05:04:35
+++ /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h 2025-10-25 07:36:30
@@ -15,28 +15,38 @@
NS_ASSUME_NONNULL_BEGIN
-/// Represents a request to upload a `PHAssetResource`
+/// An object that represents a request to upload an asset resource.
///
-/// Used within an application's `com.apple.photos.background-upload` extension to represent a request to upload a `PHAssetResource` to a destination `NSURLRequest`.
+/// Use within an application's `com.apple.photos.background-upload` extension to request an upload of a ``PHAssetResource`` to a destination <doc://com.apple.documentation/documentation/foundation/nsurlrequest>.
///
-/// When the extensions principal class receives a call to `process` background uploads, it can create new `PHAssetResourceUploadJob`s using `PHAssetResourceUploadJobChangeRequest` and any existing upload jobs can be fetched using `fetchJobsWithAction:options:` and handled by updating their state using a `PHAssetResourceUploadJobChangeRequest` to mark them as acknowledged, or to be retried. The maximum number of jobs that can be a in flight is limited to the `jobLimit`.
+/// When the extension's principal class receives a call to ``PHBackgroundResourceUploadExtension/process()`` background uploads, it can create new ``PHAssetResourceUploadJob`` objects using ``PHAssetResourceUploadJobChangeRequest``.
+///
+/// The maximum number of jobs that can be in flight is limited to the ``jobLimit``. To make space for new jobs, you must call ``PHAssetResourceUploadJobChangeRequest/fetchJobsWithAction:options:`` and retry/acknowledge them with ``PHAssetResourceUploadJobChangeRequest/acknowledge:`` or ``PHAssetResourceUploadJobChangeRequest/retryWithDestination:`` respectively.
NS_SWIFT_SENDABLE
API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos, watchos)
@interface PHAssetResourceUploadJob : PHObject
-@property (class, readonly) NSInteger jobLimit; /// The maximum number of unacknowledged upload jobs allowed, this includes registered, pending, succeeded and failed jobs.
+/// The maximum number of unacknowledged upload jobs allowed.
+///
+/// This includes jobs that are in-flight and those that have succeeded or failed.
+@property (class, readonly) NSInteger jobLimit;
-@property (strong, readonly) PHAssetResource *resource; /// The asset resource this upload job represents.
-@property (strong, readonly) NSURLRequest *destination; /// The destination to send this asset resource.
-@property (readonly) PHAssetResourceUploadJobState state; /// The state of this upload job.
+/// The asset resource this job promises to upload.
+@property (strong, readonly) PHAssetResource *resource;
+/// The destination to send the job's resource.
+@property (strong, readonly) NSURLRequest *destination;
+
+/// The state of this upload job.
+@property (readonly) PHAssetResourceUploadJobState state;
+
/// Returns all asset resource upload jobs applicable for a given action.
///
/// - Parameters:
/// - action: The actions a client can take on a job.
/// - options: The fetch options to be passed in.
///
-/// - Returns: The jobs available to apply `action` on them.
+/// - Returns: The jobs available on which you can apply an action found in ``PHAssetResourceUploadJobAction``.
+ (PHFetchResult<PHAssetResourceUploadJob *> *)fetchJobsWithAction:(PHAssetResourceUploadJobAction)action options:(nullable PHFetchOptions *)options NS_SWIFT_NAME(fetchJobs(action:options:));
@end
diff -ruN /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h
--- /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h 2025-10-16 05:04:34
+++ /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h 2025-10-25 07:36:30
@@ -11,21 +11,21 @@
NS_ASSUME_NONNULL_BEGIN
-/// Used within an application's `com.apple.photos.background-upload` extension to create and manage `PHAssetResourceUploadJob` records
+/// Use within an application's `com.apple.photos.background-upload` extension to create and change ``PHAssetResourceUploadJob`` records.
///
-/// When the extensions principal class receives a call to `process` background uploads, it can create new `PHAssetResourceUploadJob`s through calls to perform changes on a PHPhotoLibrary using `PHAssetResourceUploadJobChangeRequest` and any in-flight upload jobs can be handled by updating their state to mark them as acknowledged, or to be retried. The maximum number of jobs that can be in flight is limited to the `PHAssetResourceUploadJob.jobLimit`.
+/// When the extension's principal class receives a call to `process` background uploads, it can create new ``PHAssetResourceUploadJob``s through calls to perform changes on a PHPhotoLibrary using ``PHAssetResourceUploadJobChangeRequest`` and any in-flight upload jobs can be handled by updating their state to mark them as acknowledged, or to be retried. The maximum number of jobs that can be in flight is limited to the ``PHAssetResourceUploadJob.jobLimit``.
///
-/// `PHAssetResourceUploadJobChangeRequest` can only be created or used within a photo library change block. For details on change blocks, see `PHPhotoLibrary`.
+/// ``PHAssetResourceUploadJobChangeRequest`` can only be created or used within a photo library change block. For details on change blocks, see ``PHPhotoLibrary``.
API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos, watchos)
@interface PHAssetResourceUploadJobChangeRequest : PHChangeRequest
-/// Used to create an asset resource upload job.
+/// Creates an asset resource upload job.
///
-/// If the number of jobs exceeds `jobLimit`the photo library `performChanges` request will fail with a `PHPhotosErrorLimitExceeded` error.
-/// If you want to generate jobs after this limit is triggered, you must acknowledge succeeded and failed jobs, and wait for the registered/pending ones to be uploaded.
+/// If the number of jobs exceeds ``PHAssetResourceUploadJob/jobLimit`` the photo library ``performChanges`` request will fail with a ``PHPhotosErrorLimitExceeded`` error.
+/// To generate jobs after this limit is triggered, you must acknowledge succeeded/failed jobs, and wait for the registered/pending ones to finish uploading, which will make those jobs also succeeded/failed.
///
/// - Parameter:
-/// - destination: the destination `NSURLRequest` to which this asset resource will be sent.
+/// - destination: the destination <doc://com.apple.documentation/foundation/nsurlrequest> to which this asset resource will be sent.
/// - resource: the asset resource to be uploaded.
+ (void)createJobWithDestination:(NSURLRequest *)destination resource:(PHAssetResource *)resource NS_SWIFT_NAME(createJob(destination:resource:));
@@ -34,10 +34,10 @@
/// - Parameter job: a job to be modified.
+ (nullable instancetype)changeRequestForUploadJob:(nonnull PHAssetResourceUploadJob *)job;
-/// Acknowledges a successful or failed job. Jobs must be acknowledged to free up space for `jobLimit`.
+/// Acknowledges a successful or failed job. Jobs must be acknowledged to free up space for ``PHAssetResourceUploadJob/jobLimit``.
- (void)acknowledge;
-/// Retries a job that is failed, unacknowledged, and has not been retried before. Successful retries also free up space for `jobLimit`.
+/// Retries a job that is failed, unacknowledged, and has not been retried before. Successful retries also free up space for ``PHAssetResourceUploadJob/jobLimit``.
- (void)retryWithDestination:(nullable NSURLRequest *)destination NS_SWIFT_NAME(retry(destination:));
@end
diff -ruN /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h
--- /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h 2025-10-21 00:16:42
+++ /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h 2025-10-24 02:37:00
@@ -202,10 +202,26 @@
} NS_SWIFT_NAME(PHAssetResourceUploadJob.State) API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos);
-/// These actions correspond with the types of fetches we can make on a PHAssetResourceUploadJob and the actions we can also take on those jobs.
+/// An action to perform on an upload job.
+///
+/// Determine the available jobs for an action by calling the ``PHAssetResourceUploadJob/fetchJobsWithAction:options:`` method.
typedef NS_ENUM(NSInteger, PHAssetResourceUploadJobAction) {
- PHAssetResourceUploadJobActionAcknowledge = 1, /// Where PHAssetResourceUploadJobState = (success OR fail).
- PHAssetResourceUploadJobActionRetry = 2, /// Where PHAssetResourceUploadJobState = failed, but the job can be retried
+
+ /// A job that requires acknowledgement.
+ ///
+ /// An acknowledgeable job has a ``PHAssetResourceUploadJob/state`` of `succeeded` or `failed`
+ /// and hasn't been acknowledged.
+ ///
+ /// Call ``PHAssetResourceUploadJobChangeRequest/acknowledge`` to acknowledge a job
+ /// and free queue capacity for new uploads.
+ PHAssetResourceUploadJobActionAcknowledge = 1,
+
+ /// A job to retry processing.
+ ///
+ /// An retryable job has a ``PHAssetResourceUploadJob/state`` of `failed` and hasn't previously been retried.
+ ///
+ /// Call ``PHAssetResourceUploadJobChangeRequest/retryWithDestination:`` to retry the job.
+ PHAssetResourceUploadJobActionRetry = 2,
} NS_SWIFT_NAME(PHAssetResourceUploadJob.Action) API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos);
API_AVAILABLE_END