peachsim 0.1.1830 → 0.1.1832
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +20 -9
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +3 -3
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +20 -9
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +2 -2
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +2 -2
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +53 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +20 -9
- package/dist-lib/swift-compile.cjs +2 -2
- package/dist-lib/swift-compile.mjs +2 -2
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +3 -3
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/resilient-frame-clock.d.ts +1 -0
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAdjustmentData.h +28 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAsset.h +129 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetChangeRequest.h +143 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetCollection.h +67 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetCollectionChangeRequest.h +60 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetCreationRequest.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetExtendedMetadata.h +33 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetResource.h +67 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceManager.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJob.h +79 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobChangeRequest.h +94 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobOptions.h +23 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHChange.h +91 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHChangeRequest.h +12 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHCloudIdentifier.h +133 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHCollection.h +68 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHCollectionList.h +59 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHCollectionListChangeRequest.h +95 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHContentEditingInput.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHContentEditingOutput.h +37 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHError.h +56 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHFetchOptions.h +48 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHFetchResult.h +43 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h +251 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHLivePhoto.h +52 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHLivePhotoEditingContext.h +131 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHObject.h +32 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChange.h +29 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChangeFetchResult.h +26 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChangeToken.h +21 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHPersistentObjectChangeDetails.h +30 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h +174 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHProject.h +35 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHProjectChangeRequest.h +66 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/Photos.apinotes +12 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/Photos.h +58 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h +332 -0
- package/sdk/ios/System/Library/Frameworks/Photos.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/PhotosUI.framework/Headers/PHContentEditingController.h +48 -0
- package/sdk/ios/System/Library/Frameworks/PhotosUI.framework/Headers/PHLivePhotoView.h +117 -0
- package/sdk/ios/System/Library/Frameworks/PhotosUI.framework/Headers/PHPhotoLibrary+PhotosUISupport.h +56 -0
- package/sdk/ios/System/Library/Frameworks/PhotosUI.framework/Headers/PHPicker.h +311 -0
- package/sdk/ios/System/Library/Frameworks/PhotosUI.framework/Headers/PHSharedAlbumCreationViewController.h +112 -0
- package/sdk/ios/System/Library/Frameworks/PhotosUI.framework/Headers/PHSharedAlbumCustomizationViewController.h +76 -0
- package/sdk/ios/System/Library/Frameworks/PhotosUI.framework/Headers/PHSharedAlbumPostingViewController.h +72 -0
- package/sdk/ios/System/Library/Frameworks/PhotosUI.framework/Headers/PhotosUI.h +38 -0
- package/sdk/ios/System/Library/Frameworks/PhotosUI.framework/Modules/module.modulemap +6 -0
- package/src/nitro-dependencies.ts +3 -3
- package/src/turbo-source.ts +15 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHAssetResourceManager.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2015 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Photos/PhotosTypes.h>
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
API_AVAILABLE_BEGIN(macos(10.15), ios(9), tvos(10))
|
|
13
|
+
|
|
14
|
+
// Uniquely identify a resource data request
|
|
15
|
+
typedef int32_t PHAssetResourceDataRequestID;
|
|
16
|
+
static const PHAssetResourceDataRequestID PHInvalidAssetResourceDataRequestID = 0;
|
|
17
|
+
|
|
18
|
+
// Progress handler, called in an arbitrary serial queue.
|
|
19
|
+
typedef void (^PHAssetResourceProgressHandler)(double progress);
|
|
20
|
+
|
|
21
|
+
@class PHAssetResource;
|
|
22
|
+
|
|
23
|
+
OS_EXPORT
|
|
24
|
+
@interface PHAssetResourceRequestOptions : NSObject <NSCopying>
|
|
25
|
+
|
|
26
|
+
@property (nonatomic, assign, getter=isNetworkAccessAllowed) BOOL networkAccessAllowed;
|
|
27
|
+
@property (nonatomic, copy, nullable) PHAssetResourceProgressHandler progressHandler;
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
OS_EXPORT
|
|
33
|
+
NS_SWIFT_SENDABLE
|
|
34
|
+
@interface PHAssetResourceManager : NSObject
|
|
35
|
+
|
|
36
|
+
+ (PHAssetResourceManager *)defaultManager;
|
|
37
|
+
|
|
38
|
+
// Handlers are called on an arbitrary serial queue. The lifetime of the data is not guaranteed beyond that of the handler.
|
|
39
|
+
- (PHAssetResourceDataRequestID)requestDataForAssetResource:(PHAssetResource *)resource
|
|
40
|
+
options:(nullable PHAssetResourceRequestOptions *)options
|
|
41
|
+
dataReceivedHandler:(void (^)(NSData *data))handler
|
|
42
|
+
completionHandler:(void(^)(NSError *__nullable error))completionHandler;
|
|
43
|
+
|
|
44
|
+
// Handlers are called on an arbitrary serial queue.
|
|
45
|
+
- (void)writeDataForAssetResource:(PHAssetResource *)resource
|
|
46
|
+
toFile:(NSURL *)fileURL
|
|
47
|
+
options:(nullable PHAssetResourceRequestOptions *)options
|
|
48
|
+
completionHandler:(void(^)(NSError *__nullable error))completionHandler;
|
|
49
|
+
|
|
50
|
+
- (void)cancelDataRequest:(PHAssetResourceDataRequestID)requestID;
|
|
51
|
+
|
|
52
|
+
@end
|
|
53
|
+
|
|
54
|
+
API_AVAILABLE_END
|
|
55
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
|
|
2
|
+
//
|
|
3
|
+
// PHAssetResourceUploadJob.h
|
|
4
|
+
// PhotoKit
|
|
5
|
+
//
|
|
6
|
+
// Copyright © 2025 Apple Inc. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Photos/PHObject.h>
|
|
10
|
+
#import <Photos/PhotosTypes.h>
|
|
11
|
+
|
|
12
|
+
@class PHAssetResource;
|
|
13
|
+
@class PHFetchOptions;
|
|
14
|
+
@class PHFetchResult<T>;
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
+
|
|
18
|
+
/// An object that represents a request to upload an asset resource.
|
|
19
|
+
///
|
|
20
|
+
/// 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>.
|
|
21
|
+
///
|
|
22
|
+
/// When the extension's principal class receives a call to ``PHBackgroundResourceUploadExtension/process()`` background uploads, it can create new ``PHAssetResourceUploadJob`` objects using ``PHAssetResourceUploadJobChangeRequest``.
|
|
23
|
+
///
|
|
24
|
+
/// 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.
|
|
25
|
+
NS_SWIFT_SENDABLE
|
|
26
|
+
API_AVAILABLE(ios(26.1), macCatalyst(27.0), macos(27.0)) API_UNAVAILABLE(tvos, visionos, watchos)
|
|
27
|
+
@interface PHAssetResourceUploadJob : PHObject
|
|
28
|
+
|
|
29
|
+
/// The maximum number of unacknowledged upload jobs allowed.
|
|
30
|
+
///
|
|
31
|
+
/// This includes jobs that are in-flight and those that have succeeded or failed.
|
|
32
|
+
@property (class, readonly) NSInteger jobLimit;
|
|
33
|
+
|
|
34
|
+
/// The asset resource this job promises to upload.
|
|
35
|
+
@property (strong, readonly) PHAssetResource *resource API_DEPRECATED("Use +[PHAssetResource assetResourceForUploadJob:] instead", ios(26.1, API_TO_BE_DEPRECATED)) API_UNAVAILABLE(macos, macCatalyst);
|
|
36
|
+
|
|
37
|
+
/// The destination to send the job's resource.
|
|
38
|
+
@property (strong, readonly) NSURLRequest *destination;
|
|
39
|
+
|
|
40
|
+
/// The HTTP response headers received from the server upon completion of the upload.
|
|
41
|
+
///
|
|
42
|
+
/// This property is populated when the job reaches a terminal state (`PHAssetResourceUploadJobStateSucceeded`
|
|
43
|
+
/// or `PHAssetResourceUploadJobStateFailed`). It contains the HTTP response headers returned by the
|
|
44
|
+
/// destination server.
|
|
45
|
+
///
|
|
46
|
+
/// Header field names are normalized to lowercase for consistent lookup.
|
|
47
|
+
///
|
|
48
|
+
/// - Returns: A dictionary of response header fields, or `nil` if the job has not completed or no HTTP response was received.
|
|
49
|
+
@property (copy, readonly, nullable) NSDictionary<NSString *, NSString *> *responseHeaderFields API_AVAILABLE(ios(26.4));
|
|
50
|
+
|
|
51
|
+
/// The state of this upload job.
|
|
52
|
+
@property (readonly) PHAssetResourceUploadJobState state;
|
|
53
|
+
|
|
54
|
+
/// The type of this upload job.
|
|
55
|
+
@property (readonly) PHAssetResourceUploadJobType type;
|
|
56
|
+
|
|
57
|
+
/// The error that caused the job to fail.
|
|
58
|
+
///
|
|
59
|
+
/// This property is populated when the job reaches the `PHAssetResourceUploadJobStateFailed` state.
|
|
60
|
+
/// It provides detailed information about why the upload failed, including network errors,
|
|
61
|
+
/// server errors, or client-side errors.
|
|
62
|
+
///
|
|
63
|
+
/// - Note: The error provided is sanitized and may not be the actual error returned from URLResponse.
|
|
64
|
+
///
|
|
65
|
+
/// - Returns: An error object describing the failure, or `nil` if the job has not failed.
|
|
66
|
+
@property (readonly, nullable) NSError *error API_AVAILABLE(ios(26.4));
|
|
67
|
+
|
|
68
|
+
/// Returns all asset resource upload jobs applicable for a given action.
|
|
69
|
+
///
|
|
70
|
+
/// - Parameters:
|
|
71
|
+
/// - action: The actions a client can take on a job.
|
|
72
|
+
/// - options: The fetch options to be passed in.
|
|
73
|
+
///
|
|
74
|
+
/// - Returns: The jobs available on which you can apply an action found in ``PHAssetResourceUploadJobAction``.
|
|
75
|
+
+ (PHFetchResult<PHAssetResourceUploadJob *> *)fetchJobsWithAction:(PHAssetResourceUploadJobAction)action options:(nullable PHFetchOptions *)options NS_SWIFT_NAME(fetchJobs(action:options:));
|
|
76
|
+
|
|
77
|
+
@end
|
|
78
|
+
|
|
79
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHAssetResourceUploadJobChangeRequest.h
|
|
3
|
+
// PhotoKit
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2025 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
#import <Photos/PHChangeRequest.h>
|
|
8
|
+
|
|
9
|
+
@class PHAssetResource;
|
|
10
|
+
@class PHAssetResourceUploadJob;
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
/// Use within an application's `com.apple.photos.background-upload` extension to create and change ``PHAssetResourceUploadJob`` records.
|
|
15
|
+
///
|
|
16
|
+
/// 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``.
|
|
17
|
+
///
|
|
18
|
+
/// ``PHAssetResourceUploadJobChangeRequest`` can only be created or used within a photo library change block. For details on change blocks, see ``PHPhotoLibrary``.
|
|
19
|
+
API_AVAILABLE(ios(26.1), macCatalyst(27.0), macos(27.0)) API_UNAVAILABLE(tvos, visionos, watchos)
|
|
20
|
+
@interface PHAssetResourceUploadJobChangeRequest : PHChangeRequest
|
|
21
|
+
|
|
22
|
+
/// Creates an asset resource upload job.
|
|
23
|
+
///
|
|
24
|
+
/// If the number of jobs exceeds ``PHAssetResourceUploadJob/jobLimit`` the photo library ``performChanges`` request will fail with a ``PHPhotosErrorLimitExceeded`` error.
|
|
25
|
+
/// 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.
|
|
26
|
+
///
|
|
27
|
+
/// - Parameter:
|
|
28
|
+
/// - destination: the destination <doc://com.apple.documentation/foundation/nsurlrequest> to which this asset resource will be sent.
|
|
29
|
+
/// - resource: the asset resource to be uploaded.
|
|
30
|
+
+ (void)createJobWithDestination:(NSURLRequest *)destination resource:(PHAssetResource *)resource NS_SWIFT_NAME(createJob(destination:resource:)) API_DEPRECATED_WITH_REPLACEMENT("creationRequestForJobWithDestination:resource:", ios(26.1, 26.4));
|
|
31
|
+
|
|
32
|
+
/// Creates an asset resource upload job and returns the change request.
|
|
33
|
+
///
|
|
34
|
+
/// This method creates an upload job and returns a change request that can be used to access the placeholder
|
|
35
|
+
/// for the created job. Use the placeholder to obtain the local identifier before the change block completes.
|
|
36
|
+
///
|
|
37
|
+
/// If the number of jobs exceeds ``PHAssetResourceUploadJob/jobLimit`` the photo library ``performChanges`` request will fail with a ``PHPhotosErrorLimitExceeded`` error.
|
|
38
|
+
/// 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.
|
|
39
|
+
///
|
|
40
|
+
/// - Parameter:
|
|
41
|
+
/// - destination: the destination <doc://com.apple.documentation/foundation/nsurlrequest> to which this asset resource will be sent.
|
|
42
|
+
/// - resource: the asset resource to be uploaded.
|
|
43
|
+
/// - Returns: A change request for the created job.
|
|
44
|
+
+ (instancetype)creationRequestForJobWithDestination:(NSURLRequest *)destination resource:(PHAssetResource *)resource NS_SWIFT_NAME(creationRequestForJob(destination:resource:)) API_AVAILABLE(ios(26.4));
|
|
45
|
+
|
|
46
|
+
/// Creates a download-only job request for the specified asset resource.
|
|
47
|
+
///
|
|
48
|
+
/// This method registers a job that requests an asset resource be downloaded from iCloud to the device
|
|
49
|
+
/// without uploading it to a remote server. The download operation is performed asynchronously by the
|
|
50
|
+
/// system over time. This is useful when you need to ensure a resource is available locally for processing.
|
|
51
|
+
///
|
|
52
|
+
/// The job will transition through the same states as upload jobs (`PHAssetResourceUploadJobStateRegistered`,
|
|
53
|
+
/// `PHAssetResourceUploadJobStatePending`, and eventually `PHAssetResourceUploadJobStateSucceeded` or
|
|
54
|
+
/// `PHAssetResourceUploadJobStateFailed`), but will only perform a download operation.
|
|
55
|
+
///
|
|
56
|
+
/// Use `fetchJobsWithAction:options:` to check the job's state. When the job reaches
|
|
57
|
+
/// `PHAssetResourceUploadJobStateSucceeded`, the download has completed successfully.
|
|
58
|
+
///
|
|
59
|
+
/// - Note: The system may subsequently purge the downloaded resource due to system conditions.
|
|
60
|
+
///
|
|
61
|
+
/// - Parameter resource: The asset resource to download.
|
|
62
|
+
/// - Returns: A change request for the created job.
|
|
63
|
+
+ (instancetype)creationRequestForDownloadJobWithResource:(PHAssetResource *)resource NS_SWIFT_NAME(creationRequestForDownloadJob(resource:)) API_AVAILABLE(ios(26.4));
|
|
64
|
+
|
|
65
|
+
/// A placeholder for the asset resource upload job created by this request.
|
|
66
|
+
///
|
|
67
|
+
/// The placeholder can be used to obtain the local identifier of the job that will be created when the change block completes.
|
|
68
|
+
@property (nonatomic, strong, readonly, nullable) PHObjectPlaceholder *placeholderForCreatedAssetResourceUploadJob;
|
|
69
|
+
|
|
70
|
+
/// Creates a request for modifying the specified upload job.
|
|
71
|
+
///
|
|
72
|
+
/// - Parameter job: a job to be modified.
|
|
73
|
+
+ (nullable instancetype)changeRequestForUploadJob:(nonnull PHAssetResourceUploadJob *)job;
|
|
74
|
+
|
|
75
|
+
/// Acknowledges a successful or failed job. Jobs must be acknowledged to free up space for ``PHAssetResourceUploadJob/jobLimit``.
|
|
76
|
+
- (void)acknowledge;
|
|
77
|
+
|
|
78
|
+
/// Retries a job that is failed, unacknowledged, and has not been retried before. Successful retries also free up space for ``PHAssetResourceUploadJob/jobLimit``.
|
|
79
|
+
- (void)retryWithDestination:(nullable NSURLRequest *)destination NS_SWIFT_NAME(retry(destination:));
|
|
80
|
+
|
|
81
|
+
/// Cancels an upload job that is registered or pending.
|
|
82
|
+
///
|
|
83
|
+
/// Use this method to cancel an upload job that has not yet completed. This is useful when
|
|
84
|
+
/// a resource is uploaded through another path (e.g., the main app) and the background
|
|
85
|
+
/// upload job is no longer needed, avoiding wasteful duplicate uploads.
|
|
86
|
+
///
|
|
87
|
+
/// Only jobs in the `PHAssetResourceUploadJobStateRegistered` or `PHAssetResourceUploadJobStatePending`
|
|
88
|
+
/// states can be cancelled. Cancelled jobs transition to the `PHAssetResourceUploadJobStateCancelled` state
|
|
89
|
+
/// and are automatically acknowledged.
|
|
90
|
+
- (void)cancel API_AVAILABLE(ios(26.4));
|
|
91
|
+
|
|
92
|
+
@end
|
|
93
|
+
|
|
94
|
+
NS_ASSUME_NONNULL_END
|
package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHAssetResourceUploadJobOptions.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHAssetResourceUploadJobOptions.h
|
|
3
|
+
// Copyright © 2026 Apple Inc. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#import <Foundation/Foundation.h>
|
|
7
|
+
|
|
8
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
9
|
+
|
|
10
|
+
/// Options that affect the service behavior when processing Asset Resource Upload Jobs.
|
|
11
|
+
API_AVAILABLE(ios(27.0), macCatalyst(27.0), macos(27.0)) API_UNAVAILABLE(tvos, visionos, watchos)
|
|
12
|
+
@interface PHAssetResourceUploadJobOptions : NSObject <NSCopying>
|
|
13
|
+
|
|
14
|
+
/// Prevents expensive network access, such as cellular, for the service.
|
|
15
|
+
///
|
|
16
|
+
/// When `true`, the service only performs work for the associated configuration while the
|
|
17
|
+
/// device has a non-expensive network connection (such as Wi-Fi or Ethernet); cellular
|
|
18
|
+
/// connectivity is not used. Defaults to `false`.
|
|
19
|
+
@property (nonatomic, assign) BOOL preventsExpensiveNetworkAccess;
|
|
20
|
+
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHChange.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2013 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <Photos/PHFetchResult.h>
|
|
10
|
+
|
|
11
|
+
@class PHObject;
|
|
12
|
+
@class PHObjectChangeDetails;
|
|
13
|
+
@class PHFetchResultChangeDetails;
|
|
14
|
+
|
|
15
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
16
|
+
API_AVAILABLE_BEGIN(macos(10.13), ios(8), tvos(10))
|
|
17
|
+
|
|
18
|
+
OS_EXPORT
|
|
19
|
+
NS_SWIFT_SENDABLE
|
|
20
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface PHChange : NSObject
|
|
21
|
+
|
|
22
|
+
- (nullable PHObjectChangeDetails *)changeDetailsForObject:(PHObject *)object;
|
|
23
|
+
- (nullable PHFetchResultChangeDetails *)changeDetailsForFetchResult:(PHFetchResult *)object;
|
|
24
|
+
|
|
25
|
+
@end
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
#pragma mark -
|
|
29
|
+
OS_EXPORT
|
|
30
|
+
NS_SWIFT_SENDABLE
|
|
31
|
+
@interface PHObjectChangeDetails<ObjectType: PHObject *> : NSObject
|
|
32
|
+
|
|
33
|
+
// returns the object that was passed in to changeDetailsForObject: (used to determine the changes to the object vs. the objectAfterChanges)
|
|
34
|
+
@property (atomic, strong, readonly) ObjectType objectBeforeChanges;
|
|
35
|
+
|
|
36
|
+
// the object in the state after this change
|
|
37
|
+
@property (atomic, strong, readonly, nullable) ObjectType objectAfterChanges;
|
|
38
|
+
|
|
39
|
+
// YES if the image or video content for this object has been changed
|
|
40
|
+
@property (atomic, readonly) BOOL assetContentChanged;
|
|
41
|
+
|
|
42
|
+
// YES if the object was deleted
|
|
43
|
+
@property (atomic, readonly) BOOL objectWasDeleted;
|
|
44
|
+
|
|
45
|
+
@end
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
#pragma mark -
|
|
49
|
+
OS_EXPORT
|
|
50
|
+
NS_SWIFT_SENDABLE
|
|
51
|
+
@interface PHFetchResultChangeDetails<ObjectType: PHObject *> : NSObject
|
|
52
|
+
|
|
53
|
+
// fetch result with the state of the fetched objects before this change (returns the fetch result passed in to changeDetailsForFetchResult:)
|
|
54
|
+
@property (atomic, strong, readonly) PHFetchResult<ObjectType> *fetchResultBeforeChanges;
|
|
55
|
+
|
|
56
|
+
// fetch result with the state of the fetched objects after this change
|
|
57
|
+
@property (atomic, strong, readonly) PHFetchResult<ObjectType> *fetchResultAfterChanges;
|
|
58
|
+
|
|
59
|
+
// YES if the changes to this fetch result are described by the removed/inserted/changed details.
|
|
60
|
+
// NO indicates that the scope of changes were too large and UI clients should do a full reload, incremental changes could not be provided
|
|
61
|
+
@property (atomic, assign, readonly) BOOL hasIncrementalChanges;
|
|
62
|
+
|
|
63
|
+
// The indexes of the removed items, relative to the 'before' state of the fetch result
|
|
64
|
+
// returns nil if hasIncrementalChanges is NO
|
|
65
|
+
@property (atomic, strong, readonly, nullable) NSIndexSet *removedIndexes;
|
|
66
|
+
@property (atomic, strong, readonly) NSArray<ObjectType> *removedObjects;
|
|
67
|
+
|
|
68
|
+
// The indexes of the inserted items, relative to the 'before' state of the fetch result after applying the removedIndexes
|
|
69
|
+
// returns nil if hasIncrementalChanges is NO
|
|
70
|
+
@property (atomic, strong, readonly, nullable) NSIndexSet *insertedIndexes;
|
|
71
|
+
@property (atomic, strong, readonly) NSArray<ObjectType> *insertedObjects;
|
|
72
|
+
|
|
73
|
+
// The indexes of the updated items, relative to the 'after' state of the fetch result
|
|
74
|
+
// returns nil if hasIncrementalChanges is NO
|
|
75
|
+
@property (atomic, strong, readonly, nullable) NSIndexSet *changedIndexes;
|
|
76
|
+
@property (atomic, strong, readonly) NSArray<ObjectType> *changedObjects;
|
|
77
|
+
|
|
78
|
+
// Enumerates the indexes of the moved items, relative to the 'before' state of the fetch result after applying the removedIndexes and insertedIndexes
|
|
79
|
+
- (void)enumerateMovesWithBlock:(void(^)(NSUInteger fromIndex, NSUInteger toIndex))handler NS_SWIFT_DISABLE_ASYNC;
|
|
80
|
+
|
|
81
|
+
// YES if there are moved items
|
|
82
|
+
// returns NO if hasIncrementalChanges is NO
|
|
83
|
+
@property (atomic, assign, readonly) BOOL hasMoves;
|
|
84
|
+
|
|
85
|
+
// Provides a "diff" between 2 PHFetchResult objects.
|
|
86
|
+
+ (instancetype)changeDetailsFromFetchResult:(PHFetchResult<ObjectType> *)fromResult toFetchResult:(PHFetchResult<ObjectType> *)toResult changedObjects:(NSArray<ObjectType> *)changedObjects;
|
|
87
|
+
|
|
88
|
+
@end
|
|
89
|
+
|
|
90
|
+
API_AVAILABLE_END
|
|
91
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHCloudIdentifier.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2021 Apple, Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Photos/PHPhotoLibrary.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
API_AVAILABLE_BEGIN(macos(10.13), ios(15), tvos(15))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
OS_EXPORT
|
|
16
|
+
NS_SWIFT_SENDABLE
|
|
17
|
+
/*!
|
|
18
|
+
A representation of a globally unique identifier for a PHAsset or PHCollection that can be used to identify the same asset or collection across different devices and photo libraries.
|
|
19
|
+
|
|
20
|
+
Cloud identifiers are designed to work best when used with an account that has iCloud Photos enabled, but they also work on libraries that are not synced via iCloud Photos, including on devices that have never been signed in to an iCloud account. Use ``PHPhotoLibrary/cloudIdentifierMappingsForLocalIdentifiers:`` and ``PHPhotoLibrary/localIdentifierMappingsForCloudIdentifiers:`` to map between cloud identifiers and local identifiers.
|
|
21
|
+
|
|
22
|
+
When resolving a cloud identifier to a local identifier, ``PHPhotoLibrary/localIdentifierMappingsForCloudIdentifiers:`` first looks for a record synced through iCloud Photos. If no synced record is found — for example, when resolving cloud identifiers between libraries on devices that do not have iCloud Photos enabled — it falls back to matching on media content, which may return more than one local identifier for a single cloud identifier (see `PHPhotosErrorMultipleLocalIdentifiersFound`). To skip the media-content fallback and only resolve identifiers backed by iCloud Photos synced records, use ``PHPhotoLibrary/localIdentifierMappingsForSyncedCloudIdentifiers:``.
|
|
23
|
+
*/
|
|
24
|
+
@interface PHCloudIdentifier : NSObject <NSSecureCoding>
|
|
25
|
+
|
|
26
|
+
/// DEPRECATED: If there is a failure to determine the global identifier for a local identifier, the notFoundIdentifier is provided in that array slot.
|
|
27
|
+
@property (class, nonatomic, readonly) PHCloudIdentifier *notFoundIdentifier
|
|
28
|
+
|
|
29
|
+
API_DEPRECATED("Check for PHPhotosErrorIdentifierNotFound in PHCloudIdentifierMapping.error", macos(10.13, 12)) API_UNAVAILABLE(ios, macCatalyst, tvos);
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/// Archival string can be used to serialize and deserialize the PHCloudIdentifier
|
|
33
|
+
/// (Note the archival format is compatible with strings archived via the deprecated API `stringValue`)
|
|
34
|
+
- (nullable instancetype)initWithArchivalStringValue:(NSString *)archivalString API_AVAILABLE(macos(15.2), ios(18.2), tvos(18.2), visionos(2.2));
|
|
35
|
+
@property (nonatomic, readonly) NSString *archivalStringValue API_AVAILABLE(macos(15.2), ios(18.2), tvos(18.2), visionos(2.2));
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
- (instancetype)initWithStringValue:(NSString *)stringValue API_DEPRECATED("Use initWithArchivalStringValue: instead", macos(10.13, 27), ios(13, 27), tvos(13, 27), visionos(1, 27));
|
|
39
|
+
@property (nonatomic, readonly) NSString *stringValue API_DEPRECATED_WITH_REPLACEMENT("archivalStringValue", macos(10.13, 27), ios(13, 27), tvos(13, 27), visionos(1, 27));
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@end
|
|
44
|
+
|
|
45
|
+
API_AVAILABLE_END
|
|
46
|
+
API_AVAILABLE_BEGIN(macos(12), ios(15), tvos(15))
|
|
47
|
+
/// Contains the cloud identifier result from looking up a local identifier via `cloudIdentifierMappingsForLocalIdentifiers`, or an `error` indicating why the lookup failed
|
|
48
|
+
OS_EXPORT NS_REFINED_FOR_SWIFT
|
|
49
|
+
NS_SWIFT_SENDABLE
|
|
50
|
+
@interface PHCloudIdentifierMapping : NSObject
|
|
51
|
+
/// The cloud identifier of the record found for this local identifier
|
|
52
|
+
@property (nonatomic, readonly, nullable) PHCloudIdentifier *cloudIdentifier;
|
|
53
|
+
/// An error indicating why the `cloudIdentifier` is `nil`. `PHPhotosErrorIdentifierNotFound` if no record could be found for the provided local identifier.
|
|
54
|
+
@property (nonatomic, readonly, nullable) NSError *error;
|
|
55
|
+
@end
|
|
56
|
+
|
|
57
|
+
/// Contains the local identifier result from looking up a cloud identifier via `localIdentifierMappingsForCloudIdentifiers`, or an `error` indicating why the lookup failed
|
|
58
|
+
OS_EXPORT NS_REFINED_FOR_SWIFT
|
|
59
|
+
NS_SWIFT_SENDABLE
|
|
60
|
+
@interface PHLocalIdentifierMapping : NSObject
|
|
61
|
+
/// The `NSString` representing the local identifier of the record found for this cloud identifier, or nil if the match was not found.
|
|
62
|
+
@property (nonatomic, readonly, nullable) NSString *localIdentifier;
|
|
63
|
+
/// An error indicating why the `localIdentifier` is `nil`. `PHPhotosErrorIdentifierNotFound` if no record could be found for the provided cloud identifier. `PHPhotosErrorMultipleLocalIdentifiersFound` if the cloud identifier matched more than one photo library record, so there were multiple local identifiers found. The array of matching local identifiers can be retrieved from the error's user info via the `PHLocalIdentifiersErrorKey`
|
|
64
|
+
@property (nonatomic, readonly, nullable) NSError *error;
|
|
65
|
+
@end
|
|
66
|
+
|
|
67
|
+
@interface PHCloudIdentifier () <NSCopying>
|
|
68
|
+
@end
|
|
69
|
+
API_AVAILABLE_END
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
#pragma mark - CloudIdentifiers
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
API_AVAILABLE_BEGIN(macos(10.13), ios(15), tvos(15))
|
|
77
|
+
|
|
78
|
+
@interface PHPhotoLibrary (CloudIdentifiers)
|
|
79
|
+
/*!
|
|
80
|
+
Returns a dictionary that maps each cloud identifier from the provided array to a `PHLocalIdentifierMapping` result containing the local identifier found for that cloud identifier.
|
|
81
|
+
|
|
82
|
+
This method can be very expensive so they should be used sparingly for batch lookup of all needed identifiers. Clients should work in terms of local identifiers and call these methods only once after loading from and before saving to persistent storage. If the attempt to lookup a local identifier for a given cloud identifier fails, the error parameter will indicate the reason.
|
|
83
|
+
|
|
84
|
+
Note that cloud identifiers are designed to lookup local identifiers for records that are synced through iCloud Photo Library, but also support lookup in the following situations:
|
|
85
|
+
- looking up local identifiers with cloud identifiers generated from the same library, even if that library is not synced via iCloud Photo Library
|
|
86
|
+
- looking up PHAsset local identifiers based on media content matching if the cloud identifier hasn't synced to the device library, note that this can potentially map a cloud identifier to more than one local identifier if the cloud identifier hasn't synced and there are multiple PHAsset records with the same media content (see `PHPhotosErrorMultipleLocalIdentifiersFound`). To avoid using media matching as part of the mapping lookup strategy, use `localIdentifierMappingsForSyncedCloudIdentifiers:` instead.
|
|
87
|
+
|
|
88
|
+
- Parameters:
|
|
89
|
+
- cloudIdentifiers The array of `PHCloudIdentifier` instances whose local identifiers are being requested.
|
|
90
|
+
*/
|
|
91
|
+
- (NSDictionary <PHCloudIdentifier *, PHLocalIdentifierMapping *> *)localIdentifierMappingsForCloudIdentifiers:(NSArray<PHCloudIdentifier *> *)cloudIdentifiers API_AVAILABLE(macos(12), ios(15), tvos(15)) NS_REFINED_FOR_SWIFT;
|
|
92
|
+
|
|
93
|
+
/*!
|
|
94
|
+
Returns a dictionary that maps each cloud identifier from the provided array to a `PHLocalIdentifierMapping` result containing the local identifier found for that cloud identifier if that cloud identifier is a known synced identifier.
|
|
95
|
+
|
|
96
|
+
This method can be very expensive so they should be used sparingly for batch lookup of all needed identifiers. Clients should work in terms of local identifiers and call these methods only once after loading from and before saving to persistent storage. If the attempt to lookup a local identifier for a given cloud identifier fails, the error parameter will indicate the reason.
|
|
97
|
+
|
|
98
|
+
Use this method instead of `localIdentifierMappingsForCloudIdentifiers:` to avoid looking up PHAsset local identifiers based on the media content matching
|
|
99
|
+
|
|
100
|
+
- Parameters:
|
|
101
|
+
- cloudIdentifiers The array of `PHCloudIdentifier` instances whose local identifiers are being requested.
|
|
102
|
+
*/
|
|
103
|
+
- (NSDictionary <PHCloudIdentifier *, PHLocalIdentifierMapping *> *)localIdentifierMappingsForSyncedCloudIdentifiers:(NSArray<PHCloudIdentifier *> *)cloudIdentifiers API_AVAILABLE(macos(27), ios(27), tvos(27), visionos(27)) NS_REFINED_FOR_SWIFT;
|
|
104
|
+
|
|
105
|
+
/*!
|
|
106
|
+
Returns a dictionary that maps each local identifier from the provided array to a `PHCloudIdentifierMapping` result containing the cloud identifier found for that local identifier
|
|
107
|
+
|
|
108
|
+
This method can be very expensive so they should be used sparingly for batch lookup of all needed identifiers. Clients should work in terms of local identifiers and call these methods only once after loading from and before saving to persistent storage. If the attempt to lookup a cloud identifier for a given local identifier fails, the error parameter will indicate the reason.
|
|
109
|
+
- Parameters:
|
|
110
|
+
- localIdentifiers The array of `NSString` instances whose cloud identifiers are being requested.
|
|
111
|
+
*/
|
|
112
|
+
- (NSDictionary <NSString *, PHCloudIdentifierMapping *> *)cloudIdentifierMappingsForLocalIdentifiers:(NSArray<NSString *> *)localIdentifiers API_AVAILABLE(macos(12), ios(15), tvos(15)) NS_REFINED_FOR_SWIFT;
|
|
113
|
+
|
|
114
|
+
/// DEPRECATED: These two methods can be very expensive so they should be used sparingly for batch lookup of all needed identifiers. Clients should work in terms of local identifiers and call these methods only once after loading from and before saving to persistent storage.
|
|
115
|
+
- (NSArray<NSString *> *)localIdentifiersForCloudIdentifiers:(NSArray<PHCloudIdentifier *> *)cloudIdentifiers
|
|
116
|
+
|
|
117
|
+
API_DEPRECATED("Use localIdentifierMappingsForCloudIdentifiers: instead", macos(10.13, 12)) API_UNAVAILABLE(ios, macCatalyst, tvos);
|
|
118
|
+
|
|
119
|
+
- (NSArray<PHCloudIdentifier *> *)cloudIdentifiersForLocalIdentifiers:(NSArray<NSString *> *)localIdentifiers
|
|
120
|
+
|
|
121
|
+
API_DEPRECATED("Use cloudIdentifierMappingsForLocalIdentifiers: instead", macos(10.13, 12)) API_UNAVAILABLE(ios, macCatalyst, tvos);
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
@end
|
|
125
|
+
|
|
126
|
+
/// DEPRECATED: If the local object cannot be resolved from a global identifier, `PHLocalIdentifierNotFound` is provided in that array slot.
|
|
127
|
+
extern NSString * const PHLocalIdentifierNotFound
|
|
128
|
+
|
|
129
|
+
API_DEPRECATED("Check for PHPhotosErrorIdentifierNotFound in PHLocalIdentifierMapping.error", macos(10.13, 12)) API_UNAVAILABLE(ios, macCatalyst, tvos);
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
API_AVAILABLE_END
|
|
133
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHCollection.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2013 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Photos/PHObject.h>
|
|
9
|
+
#import <Photos/PHFetchResult.h>
|
|
10
|
+
#import <Photos/PhotosTypes.h>
|
|
11
|
+
|
|
12
|
+
@class PHCollectionList, PHFetchResult, PHFetchOptions;
|
|
13
|
+
@class CLLocation;
|
|
14
|
+
|
|
15
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
16
|
+
API_AVAILABLE_BEGIN(macos(10.15), ios(8), tvos(10))
|
|
17
|
+
|
|
18
|
+
OS_EXPORT API_AVAILABLE(macos(10.13))
|
|
19
|
+
NS_SWIFT_SENDABLE
|
|
20
|
+
@interface PHCollection : PHObject
|
|
21
|
+
|
|
22
|
+
@property (nonatomic, assign, readonly) BOOL canContainAssets;
|
|
23
|
+
@property (nonatomic, assign, readonly) BOOL canContainCollections;
|
|
24
|
+
@property (nonatomic, strong, readonly, nullable) NSString *localizedTitle API_AVAILABLE(macos(10.13));
|
|
25
|
+
|
|
26
|
+
/// The last date at which this collection was modified.
|
|
27
|
+
@property (nonatomic, strong, readonly, nullable) NSDate *modificationDate API_AVAILABLE(macos(26), ios(26), tvos(26), visionos(26));
|
|
28
|
+
|
|
29
|
+
#pragma mark - Capabilities
|
|
30
|
+
|
|
31
|
+
- (BOOL)canPerformEditOperation:(PHCollectionEditOperation)anOperation;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
#pragma mark - Fetching collections
|
|
35
|
+
|
|
36
|
+
/*!
|
|
37
|
+
Retrieves collections from the specified collection list
|
|
38
|
+
|
|
39
|
+
By default, the returned `PHFetchResult` object contains all collections in the specified collection list. To retrieve a more specific set of assets, provide a `PHFetchOptions` object that contains a filter predicate.
|
|
40
|
+
|
|
41
|
+
- Parameters:
|
|
42
|
+
- collectionList: The collection list from which to fetch collections
|
|
43
|
+
- options: Options that specify a filter predicate and sort order for the fetched collections, or nil to use default options
|
|
44
|
+
|
|
45
|
+
- Returns: A fetch result that contains the requested `PHCollection` objects, or an empty fetch result if no objects match the request.
|
|
46
|
+
*/
|
|
47
|
+
+ (PHFetchResult<PHCollection *> *)fetchCollectionsInCollectionList:(PHCollectionList *)collectionList options:(nullable PHFetchOptions *)options;
|
|
48
|
+
|
|
49
|
+
/*!
|
|
50
|
+
Retrieves collections from the root of the photo library’s hierarchy of user-created albums and folders
|
|
51
|
+
|
|
52
|
+
This is the equivalent to calling `fetchCollectionsInCollectionList:options:` with the collection list matching the type `PHCollectionListTypeFolder` and subtype `PHCollectionListSubtypeRootFolder`
|
|
53
|
+
|
|
54
|
+
- Parameters:
|
|
55
|
+
- options: Options that specify a filter predicate and sort order for the fetched collections, or nil to use default options
|
|
56
|
+
|
|
57
|
+
- Returns: A fetch result containing the matching collection lists, in the library's natural order.
|
|
58
|
+
*/
|
|
59
|
+
+ (PHFetchResult<PHCollection *> *)fetchTopLevelUserCollectionsWithOptions:(nullable PHFetchOptions *)options;
|
|
60
|
+
|
|
61
|
+
@end
|
|
62
|
+
|
|
63
|
+
API_AVAILABLE_END
|
|
64
|
+
NS_ASSUME_NONNULL_END
|
|
65
|
+
|
|
66
|
+
// PHCollection subclasses declarations have been moved to their own header files, imported here for compatibility
|
|
67
|
+
#import <Photos/PHAssetCollection.h>
|
|
68
|
+
#import <Photos/PHCollectionList.h>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHCollectionList.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2013-2025 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Photos/PHCollection.h>
|
|
9
|
+
#import <Photos/PhotosTypes.h>
|
|
10
|
+
|
|
11
|
+
@class PHAssetCollection, PHFetchResult, PHFetchOptions;
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
+
API_AVAILABLE_BEGIN(macos(10.15), ios(8), tvos(10))
|
|
15
|
+
|
|
16
|
+
OS_EXPORT API_AVAILABLE(macos(10.13))
|
|
17
|
+
NS_SWIFT_SENDABLE
|
|
18
|
+
@interface PHCollectionList : PHCollection
|
|
19
|
+
|
|
20
|
+
@property (nonatomic, assign, readonly) PHCollectionListType collectionListType;
|
|
21
|
+
@property (nonatomic, assign, readonly) PHCollectionListSubtype collectionListSubtype;
|
|
22
|
+
|
|
23
|
+
@property (nonatomic, strong, readonly, nullable) NSDate *startDate;
|
|
24
|
+
@property (nonatomic, strong, readonly, nullable) NSDate *endDate;
|
|
25
|
+
|
|
26
|
+
@property (nonatomic, strong, readonly) NSArray<NSString *> *localizedLocationNames;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
#pragma mark - Fetching collection lists
|
|
30
|
+
|
|
31
|
+
// A PHAssetCollectionTypeMoment will be contained by a PHCollectionListSubtypeMomentListCluster and a PHCollectionListSubtypeMomentListYear
|
|
32
|
+
// Non-moment PHAssetCollections will only be contained by a single collection list
|
|
33
|
+
+ (PHFetchResult<PHCollectionList *> *)fetchCollectionListsContainingCollection:(PHCollection *)collection options:(nullable PHFetchOptions *)options;
|
|
34
|
+
|
|
35
|
+
// Fetch collection lists of a single type matching the provided local identifiers (type is inferred from the local identifiers)
|
|
36
|
+
+ (PHFetchResult<PHCollectionList *> *)fetchCollectionListsWithLocalIdentifiers:(NSArray<NSString *> *)identifiers options:(nullable PHFetchOptions *)options;
|
|
37
|
+
|
|
38
|
+
// Fetch asset collections of a single type and subtype provided (use PHCollectionListSubtypeAny to match all subtypes)
|
|
39
|
+
+ (PHFetchResult<PHCollectionList *> *)fetchCollectionListsWithType:(PHCollectionListType)collectionListType subtype:(PHCollectionListSubtype)subtype options:(nullable PHFetchOptions *)options;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
#pragma mark - Fetching moment collection lists (Deprecated)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
+ (PHFetchResult<PHCollectionList *> *)fetchMomentListsWithSubtype:(PHCollectionListSubtype)momentListSubtype containingMoment:(PHAssetCollection *)moment options:(nullable PHFetchOptions *)options API_DEPRECATED("Will be removed in a future release", ios(8, 13), tvos(10, 13)) API_UNAVAILABLE(macos);
|
|
46
|
+
+ (PHFetchResult<PHCollectionList *> *)fetchMomentListsWithSubtype:(PHCollectionListSubtype)momentListSubtype options:(nullable PHFetchOptions *)options API_DEPRECATED("Will be removed in a future release", ios(8, 13), tvos(10, 13)) API_UNAVAILABLE(macos);
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
#pragma mark - Transient collection lists
|
|
51
|
+
|
|
52
|
+
// These collection lists are only in-memory and are not persisted to disk
|
|
53
|
+
+ (PHCollectionList *)transientCollectionListWithCollections:(NSArray<PHCollection *> *)collections title:(nullable NSString *)title;
|
|
54
|
+
+ (PHCollectionList *)transientCollectionListWithCollectionsFetchResult:(PHFetchResult<PHCollection *> *)fetchResult title:(nullable NSString *)title;
|
|
55
|
+
|
|
56
|
+
@end
|
|
57
|
+
|
|
58
|
+
API_AVAILABLE_END
|
|
59
|
+
NS_ASSUME_NONNULL_END
|