-
Notifications
You must be signed in to change notification settings - Fork 549
Photos iOS 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/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h
--- /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h 2025-10-21 00:16:42
+++ /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h 2025-10-25 07:42:18
@@ -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/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h
--- /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h 2025-10-21 00:16:42
+++ /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h 2025-10-25 07:42:18
@@ -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/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h
--- /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h 2025-10-21 00:16:42
+++ /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h 2025-10-25 07:42:18
@@ -69,17 +69,24 @@
+ (void)requestAuthorization:(void(^)(PHAuthorizationStatus status))handler API_DEPRECATED_WITH_REPLACEMENT("+requestAuthorizationForAccessLevel:handler:", ios(8, API_TO_BE_DEPRECATED), macos(10.13, API_TO_BE_DEPRECATED), tvos(10, API_TO_BE_DEPRECATED));
#if TARGET_OS_IOS && !TARGET_OS_VISION
-#pragma mark - Background Upload Jobs
+#pragma mark - Background Upload of Asset Resources: Feature and Extension Enablement
+
+/// A Boolean value that indicates whether background asset resource uploading is enabled.
+///
+/// The value is `true` if the extension is enabled and active, and is `false` otherwise.
+///
+/// The extension's host app uses this property to determine the background processing status. See ``PHAssetResourceUploadJob`` and ````PHAssetResourceUploadJobChangeRequest`` for more information.
+@property (readonly, getter=isUploadJobExtensionEnabled) BOOL uploadJobExtensionEnabled API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos) NS_SWIFT_NAME(uploadJobExtensionEnabled);
-@property (readonly, getter=isUploadJobExtensionEnabled) BOOL uploadJobExtensionEnabled API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos) NS_SWIFT_NAME(uploadJobExtensionEnabled); /// Returns `YES` if the extension is enabled and active, otherwise `NO`. This is used by the extension's host application to determine the background processing status.
-
-/// Enables or disables the background asset resource upload job processing. This must be called before creating `PHAssetResourceUploadJob`, by the extension's host application.
+/// Enables or disables the background asset resource upload job feature.
///
-/// Enabling BackgroundUploadJobs requires full library access and the extension registered to the extension point: "com.apple.photos.background-upload".
+/// You must call this function before you create ``PHAssetResourceUploadJob`` in the extension's host application.
///
+/// To enable background uploads, you must have both full library access and register the extension with the extension point: "com.apple.photos.background-upload".
+///
/// - Parameters:
-/// - enable: YES to enable the upload job extension processing and allow the creation of PHAssetResourceUploadJobs. NO to disable processing the host application's extension.
-/// - error: If enabling or disabling was unsuccessful, `NO` is returned and an error is set on the `error` parameter.
+/// - enable: `true` allows calls to the extension's host application; you can fulfill that protocol to create ``PHAssetResourceUploadJob`` objects. `false` stops calls to the extension's host application.
+/// - error: if either enabling or disabling was unsuccessful, `false` is returned and an error is set on the `error` parameter.
- (BOOL)setUploadJobExtensionEnabled:(BOOL)enable error:(NSError * __autoreleasing *)error API_AVAILABLE(ios(26.1)) API_UNAVAILABLE(macos, macCatalyst, tvos, visionos);
#endif
diff -ruN /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h /Applications/Xcode_26.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h
--- /Applications/Xcode_26.1.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.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/iPhoneOS.platform/Developer/SDKs/iPhoneOS.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