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
package/sdk/ios/System/Library/Frameworks/Photos.framework/Headers/PHCollectionListChangeRequest.h
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHCollectionListChangeRequest.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2013 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <Photos/PHChangeRequest.h>
|
|
10
|
+
#import <Photos/PHFetchResult.h>
|
|
11
|
+
|
|
12
|
+
@class PHCollection;
|
|
13
|
+
@class PHCollectionList;
|
|
14
|
+
@class PHObjectPlaceholder;
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
+
API_AVAILABLE_BEGIN(macos(10.15), ios(8), tvos(10))
|
|
18
|
+
|
|
19
|
+
// PHCollectionListChangeRequest can only be created or used within a -[PHPhotoLibrary performChanges:] or -[PHPhotoLibrary performChangesAndWait:] block.
|
|
20
|
+
OS_EXPORT
|
|
21
|
+
@interface PHCollectionListChangeRequest : PHChangeRequest
|
|
22
|
+
|
|
23
|
+
#pragma mark - Creating Collection Lists
|
|
24
|
+
|
|
25
|
+
+ (instancetype)creationRequestForCollectionListWithTitle:(NSString *)title;
|
|
26
|
+
|
|
27
|
+
// This can be used to fetch the newly created collection list after the change block has completed by using -localIdentifier
|
|
28
|
+
// It can also be added directly to collection lists within the current change block
|
|
29
|
+
@property (nonatomic, strong, readonly) PHObjectPlaceholder *placeholderForCreatedCollectionList;
|
|
30
|
+
|
|
31
|
+
#pragma mark - Deleting Collection Lists
|
|
32
|
+
|
|
33
|
+
// requests that the specified collection lists and all their child collections (recursively) be deleted
|
|
34
|
+
+ (void)deleteCollectionLists:(id<NSFastEnumeration>)collectionLists;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
#pragma mark - Modifying Collection Lists
|
|
38
|
+
|
|
39
|
+
/*!
|
|
40
|
+
Creates a request for modifying the specified collection list.
|
|
41
|
+
|
|
42
|
+
After you create a change request within a photo library change block, propose changes to the collection’s title or list of child collections with the properties and instance methods of the change request. After Photos runs your change block, the collection list reflects your changes. For details on change blocks, see PHPhotoLibrary.
|
|
43
|
+
|
|
44
|
+
Use this method when you you don’t need to work with indexes in the list of child collections. If you need to insert, remove, or rearrange collections at specified indexes in the collection list, use the `changeRequestForCollectionList:childCollections:` method instead.
|
|
45
|
+
|
|
46
|
+
Use `canPerformEditOperation:` on the collection list to determine if the type of change is allowed. If the collection list does not allow the type of change requested the changes request will fail and an error is returned.
|
|
47
|
+
|
|
48
|
+
- Parameters:
|
|
49
|
+
- collectionList: the collection list being modified
|
|
50
|
+
*/
|
|
51
|
+
+ (nullable instancetype)changeRequestForCollectionList:(PHCollectionList *)collectionList;
|
|
52
|
+
|
|
53
|
+
/*!
|
|
54
|
+
Creates a request for modifying the specified collection list, with a fetch result for tracking changes.
|
|
55
|
+
|
|
56
|
+
Use this method when you need to insert, remove, or rearrange collections at specified indexes in the collection list. By passing in a fetch result reflecting what your app sees as the current state of the collection’s membership, the Photos framework can ensure that the indexes you specify are valid even if the collection has changed since you last fetched it. If you don’t need to work with indexes in the list of child collections, you can use the `changeRequestForCollectionList:` method instead.
|
|
57
|
+
|
|
58
|
+
Call `canPerformEditOperation:` on the collection list to determine if the type of change is allowed. If the collection list does not allow the type of change requested, the .
|
|
59
|
+
|
|
60
|
+
- Parameters:
|
|
61
|
+
- collectionList: the collection list being modified
|
|
62
|
+
- childCollections: the child collections to modify (see `fetchCollectionsInCollectionList:options:`)
|
|
63
|
+
*/
|
|
64
|
+
+ (nullable instancetype)changeRequestForCollectionList:(PHCollectionList *)collectionList childCollections:(PHFetchResult<__kindof PHCollection *> *)childCollections;
|
|
65
|
+
|
|
66
|
+
/*!
|
|
67
|
+
Creates a request to add, remove, or rearrange child collections in the top-level collection list.
|
|
68
|
+
|
|
69
|
+
To add, remove or rearrange child collections in the top-level collection list, passing in the fetched collections in that collection list will ensure that the child collection positions are tracked correctly in the case that the collection list has been externally edited after the fetch, but before this change is applied
|
|
70
|
+
|
|
71
|
+
This is the equivalent to calling `changeRequestForCollectionList:childCollections:` with the collection list matching the type `PHCollectionListTypeFolder` and subtype `PHCollectionListSubtypeRootFolder`
|
|
72
|
+
|
|
73
|
+
- Parameters:
|
|
74
|
+
- childCollections: the child collections to modify (see `fetchTopLevelUserCollections:options:`)
|
|
75
|
+
*/
|
|
76
|
+
+ (nullable instancetype)changeRequestForTopLevelCollectionListUserCollections:(PHFetchResult<__kindof PHCollection *> *)childCollections API_AVAILABLE(macos(11), ios(14.2), tvos(14));
|
|
77
|
+
|
|
78
|
+
@property (nonatomic, strong, readwrite) NSString *title;
|
|
79
|
+
|
|
80
|
+
#pragma mark - Mutating child collections
|
|
81
|
+
|
|
82
|
+
// A PHCollection can only belong to a single parent PHCollection
|
|
83
|
+
- (void)addChildCollections:(id<NSFastEnumeration>)collections;
|
|
84
|
+
- (void)insertChildCollections:(id<NSFastEnumeration>)collections atIndexes:(NSIndexSet *)indexes;
|
|
85
|
+
- (void)removeChildCollections:(id<NSFastEnumeration>)collections;
|
|
86
|
+
- (void)removeChildCollectionsAtIndexes:(NSIndexSet *)indexes;
|
|
87
|
+
- (void)replaceChildCollectionsAtIndexes:(NSIndexSet *)indexes withChildCollections:(id<NSFastEnumeration>)collections;
|
|
88
|
+
|
|
89
|
+
// The move removes the child collections at fromIndexes first then inserts those collections at the toIndex, so toIndex should point to a location based on the updated indexes after having removed the child collections at fromIndexes
|
|
90
|
+
- (void)moveChildCollectionsAtIndexes:(NSIndexSet *)indexes toIndex:(NSUInteger)toIndex;
|
|
91
|
+
|
|
92
|
+
@end
|
|
93
|
+
|
|
94
|
+
API_AVAILABLE_END
|
|
95
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHContentEditingInput.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2014 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <Photos/PhotosTypes.h>
|
|
10
|
+
|
|
11
|
+
@class PHAdjustmentData;
|
|
12
|
+
@class AVAsset;
|
|
13
|
+
@class CLLocation;
|
|
14
|
+
@class PHLivePhoto;
|
|
15
|
+
@class UTType;
|
|
16
|
+
@class UIImage;
|
|
17
|
+
|
|
18
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
19
|
+
API_AVAILABLE_BEGIN(macos(10.11), ios(8), tvos(10))
|
|
20
|
+
|
|
21
|
+
OS_EXPORT
|
|
22
|
+
@interface PHContentEditingInput : NSObject
|
|
23
|
+
|
|
24
|
+
@property (readonly, assign) PHAssetMediaType mediaType;
|
|
25
|
+
@property (readonly, assign) PHAssetMediaSubtype mediaSubtypes;
|
|
26
|
+
@property (readonly, copy, nullable) NSDate *creationDate;
|
|
27
|
+
@property (readonly, copy, nullable) CLLocation *location;
|
|
28
|
+
|
|
29
|
+
/// The type of data provided as the asset's content editing input image or video.
|
|
30
|
+
@property (readonly, copy, nullable) UTType *contentType API_AVAILABLE(macos(26.0), ios(26.0), tvos(26.0), visionos(26.0));
|
|
31
|
+
@property (readonly, copy, nullable) NSString *uniformTypeIdentifier API_DEPRECATED("Use contentType instead", ios(8, API_TO_BE_DEPRECATED), macos(10.11, API_TO_BE_DEPRECATED), tvos(10, API_TO_BE_DEPRECATED), visionos(1, API_TO_BE_DEPRECATED));
|
|
32
|
+
|
|
33
|
+
// Playback style describes how the content should be presented to the user. Use this value to choose the type of view and the appropriate APIs on the content editing input to display this content.
|
|
34
|
+
// When editing a live photo with a PHAssetPlaybackStyleLoopingVideo, you should provide an updated video that includes the looping video metadata on the PHContentEditingOutput's renderedContentURL.
|
|
35
|
+
@property (nonatomic, assign, readonly) PHAssetPlaybackStyle playbackStyle API_AVAILABLE(macos(10.13), ios(11), tvos(11));
|
|
36
|
+
|
|
37
|
+
// Adjustments to be applied onto the provided input image or video.
|
|
38
|
+
@property (readonly, strong, nullable) PHAdjustmentData *adjustmentData;
|
|
39
|
+
|
|
40
|
+
// Input image:
|
|
41
|
+
@property (readonly, strong, nullable) UIImage *displaySizeImage;
|
|
42
|
+
@property (readonly, copy, nullable) NSURL *fullSizeImageURL;
|
|
43
|
+
@property (readonly, assign) int fullSizeImageOrientation; // EXIF value
|
|
44
|
+
|
|
45
|
+
// Input video:
|
|
46
|
+
@property (readonly, strong, nullable) AVAsset *avAsset API_DEPRECATED_WITH_REPLACEMENT("-audiovisualAsset", ios(8,9)) API_UNAVAILABLE(macos);
|
|
47
|
+
@property (readonly, strong, nullable) AVAsset *audiovisualAsset API_AVAILABLE(macos(10.11), ios(9));
|
|
48
|
+
|
|
49
|
+
// Input Live Photo:
|
|
50
|
+
@property (readonly, strong, nullable) PHLivePhoto *livePhoto API_AVAILABLE(macos(10.12), ios(10));
|
|
51
|
+
|
|
52
|
+
@end
|
|
53
|
+
|
|
54
|
+
API_AVAILABLE_END
|
|
55
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHContentEditingOutput.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2014 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@class PHContentEditingInput, PHAdjustmentData, UTType;
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
API_AVAILABLE_BEGIN(macos(10.11), ios(8), tvos(10))
|
|
14
|
+
|
|
15
|
+
OS_EXPORT
|
|
16
|
+
@interface PHContentEditingOutput : NSObject
|
|
17
|
+
|
|
18
|
+
- (instancetype)initWithContentEditingInput:(PHContentEditingInput *)contentEditingInput;
|
|
19
|
+
|
|
20
|
+
@property (readwrite, strong, nullable) PHAdjustmentData *adjustmentData;
|
|
21
|
+
|
|
22
|
+
/// File URL where the rendered output in the default format, with adjustments baked-in, needs to be written to.
|
|
23
|
+
@property (readonly, copy) NSURL *renderedContentURL;
|
|
24
|
+
|
|
25
|
+
/// Returns the default type for the rendered content output
|
|
26
|
+
@property (readonly, copy, nullable) UTType *defaultRenderedContentType API_AVAILABLE(macos(14), ios(17), tvos(17));
|
|
27
|
+
|
|
28
|
+
/// Returns the supported types for the rendered content output
|
|
29
|
+
@property (readonly, copy) NSArray<UTType *> *supportedRenderedContentTypes API_AVAILABLE(macos(14), ios(17), tvos(17));
|
|
30
|
+
|
|
31
|
+
/// Returns a file URL where the rendered output in the specified format, with adjustments baked-in, needs to be written to. Returns nil and provides an error identifying the reason if the format is unsupported or the requested content URL cannot be provided
|
|
32
|
+
- (nullable NSURL *)renderedContentURLForType:(UTType *)type error:(NSError * __autoreleasing *)error API_AVAILABLE(macos(14), ios(17), tvos(17));
|
|
33
|
+
|
|
34
|
+
@end
|
|
35
|
+
|
|
36
|
+
API_AVAILABLE_END
|
|
37
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHError.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2019 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
API_AVAILABLE_BEGIN(macos(10.15), ios(13), tvos(13))
|
|
11
|
+
|
|
12
|
+
OS_EXPORT NSErrorDomain const PHPhotosErrorDomain;
|
|
13
|
+
|
|
14
|
+
/// Array of NSString values representing local identifiers related to the specific error
|
|
15
|
+
extern NSErrorUserInfoKey const PHLocalIdentifiersErrorKey API_AVAILABLE(macos(12), ios(15), tvos(15));
|
|
16
|
+
|
|
17
|
+
typedef NS_ERROR_ENUM(PHPhotosErrorDomain, PHPhotosError) {
|
|
18
|
+
PHPhotosErrorInternalError API_AVAILABLE(macos(10.15), ios(13), tvos(13)) = -1, // An unknown, internal error occured
|
|
19
|
+
|
|
20
|
+
PHPhotosErrorUserCancelled = 3072, // The user cancelled the asset resource or editing request
|
|
21
|
+
PHPhotosErrorLibraryVolumeOffline = 3114, // The photo library is unavailable because the file system volume that contains it is not mounted (register for PHPhotoLibraryAvailabilityObserver)
|
|
22
|
+
PHPhotosErrorRelinquishingLibraryBundleToWriter = 3142, // The photo library became unavailable because the user moved, renamed, or deleted the system photo library (register for PHPhotoLibraryAvailabilityObserver)
|
|
23
|
+
PHPhotosErrorSwitchingSystemPhotoLibrary = 3143, // The photo library became unavailable because the user switched the system photo library (register for PHPhotoLibraryAvailabilityObserver)
|
|
24
|
+
PHPhotosErrorNetworkAccessRequired API_AVAILABLE(macos(11), ios(14), tvos(14)) = 3164, // The request for an asset resource failed because network access is required, set networkAccessAllowed = YES to enable network access
|
|
25
|
+
PHPhotosErrorNetworkError API_AVAILABLE(macos(13), ios(16), tvos(16)) = 3169, // The request for an asset resource failed due to a network connection error
|
|
26
|
+
PHPhotosErrorIdentifierNotFound API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3201, // Identifier was not found
|
|
27
|
+
PHPhotosErrorMultipleIdentifiersFound API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3202, // More than one identifier was found
|
|
28
|
+
|
|
29
|
+
PHPhotosErrorChangeNotSupported API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3300, // The change request is not supported as configured
|
|
30
|
+
PHPhotosErrorOperationInterrupted API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3301, // Operation was interrupted and could not be completed, transient error
|
|
31
|
+
PHPhotosErrorInvalidResource API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3302, // Asset resource validation failed
|
|
32
|
+
PHPhotosErrorMissingResource API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3303, // Asset resource missing
|
|
33
|
+
PHPhotosErrorNotEnoughSpace API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3305, // Not enough space to perform the requested change
|
|
34
|
+
PHPhotosErrorRequestNotSupportedForAsset API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3306, // The request could not be completed because it is not supported for the specified asset
|
|
35
|
+
PHPhotosErrorLimitExceeded API_AVAILABLE(macos(26.1), ios(26.1), tvos(26.1)) = 3307, // The request could not be completed because a limit would be exceeded
|
|
36
|
+
|
|
37
|
+
PHPhotosErrorAccessRestricted API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3310, // Access restricted by system configuration
|
|
38
|
+
PHPhotosErrorAccessUserDenied API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3311, // The user has denied access
|
|
39
|
+
|
|
40
|
+
PHPhotosErrorLibraryInFileProviderSyncRoot API_AVAILABLE(macos(12.3), ios(15.4), tvos(15.4)) = 5423, // The Photos library bundle is in a File Provider Sync Root directory, which is not supported because it can corrupt the photo library
|
|
41
|
+
|
|
42
|
+
PHPhotosErrorPersistentChangeTokenExpired API_AVAILABLE(macos(13), ios(16), tvos(16)) = 3105, // The change token refers to a library state that is older than the available history of persistent changes
|
|
43
|
+
PHPhotosErrorPersistentChangeDetailsUnavailable API_AVAILABLE(macos(13), ios(16), tvos(16)) = 3210, // Change details are not available for this persistent change, and therefore the current library state cannot be reconstructed from change history
|
|
44
|
+
|
|
45
|
+
PHPhotosErrorInvalid API_DEPRECATED_WITH_REPLACEMENT("PHPhotosErrorInternalError", macos(10.15, 12), ios(13, 15), tvos(13, 15)) = -1, // DEPRECATED An unknown error occured
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
#ifdef __swift__
|
|
49
|
+
static const NSInteger PHPhotosErrorInvalidDeprecated NS_SWIFT_NAME(PHPhotosErrorInvalid) API_DEPRECATED_WITH_REPLACEMENT("PHPhotosErrorInvalid", macos(10.15, 11), ios(13, 14), tvos(13, 14)) = PHPhotosErrorInvalid;
|
|
50
|
+
static const NSInteger PHPhotosErrorUserCancelledDeprecated NS_SWIFT_NAME(PHPhotosErrorUserCancelled) API_DEPRECATED_WITH_REPLACEMENT("PHPhotosErrorUserCancelled", macos(10.15, 11), ios(13, 14), tvos(13, 14)) = PHPhotosErrorUserCancelled;
|
|
51
|
+
static const NSInteger PHPhotosErrorLibraryVolumeOfflineDeprecated NS_SWIFT_NAME(PHPhotosErrorLibraryVolumeOffline) API_DEPRECATED_WITH_REPLACEMENT("PHPhotosErrorLibraryVolumeOffline", macos(10.15, 11), ios(13, 14), tvos(13, 14)) = PHPhotosErrorLibraryVolumeOffline;
|
|
52
|
+
static const NSInteger PHPhotosErrorRelinquishingLibraryBundleToWriterDeprecated NS_SWIFT_NAME(PHPhotosErrorRelinquishingLibraryBundleToWriter) API_DEPRECATED_WITH_REPLACEMENT("PHPhotosErrorRelinquishingLibraryBundleToWriter", macos(10.15, 11), ios(13, 14), tvos(13, 14)) = PHPhotosErrorRelinquishingLibraryBundleToWriter;
|
|
53
|
+
static const NSInteger PHPhotosErrorSwitchingSystemPhotoLibraryDeprecated NS_SWIFT_NAME(PHPhotosErrorSwitchingSystemPhotoLibrary) API_DEPRECATED_WITH_REPLACEMENT("PHPhotosErrorSwitchingSystemPhotoLibrary", macos(10.15, 11), ios(13, 14), tvos(13, 14)) = PHPhotosErrorSwitchingSystemPhotoLibrary;
|
|
54
|
+
#endif
|
|
55
|
+
|
|
56
|
+
API_AVAILABLE_END
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHFetchOptions.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2014 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <Photos/PhotosTypes.h>
|
|
10
|
+
|
|
11
|
+
@class PHObject;
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
+
API_AVAILABLE_BEGIN(macos(10.13), ios(8), tvos(10))
|
|
15
|
+
|
|
16
|
+
OS_EXPORT
|
|
17
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface PHFetchOptions : NSObject <NSCopying>
|
|
18
|
+
|
|
19
|
+
// Some predicates / sorts may be suboptimal and we will log
|
|
20
|
+
@property (nonatomic, strong, nullable) NSPredicate *predicate;
|
|
21
|
+
@property (nonatomic, strong, nullable) NSArray<NSSortDescriptor *> *sortDescriptors;
|
|
22
|
+
|
|
23
|
+
// Whether hidden assets are included in fetch results. Defaults to NO
|
|
24
|
+
@property (nonatomic, assign) BOOL includeHiddenAssets;
|
|
25
|
+
|
|
26
|
+
// Whether hidden burst assets are included in fetch results. Defaults to NO
|
|
27
|
+
@property (nonatomic, assign) BOOL includeAllBurstAssets API_AVAILABLE(macos(10.15));
|
|
28
|
+
|
|
29
|
+
// The asset source types included in the fetch results. Defaults to PHAssetSourceTypeNone.
|
|
30
|
+
// If set to PHAssetSourceTypeNone the asset source types included in the fetch results are inferred from the type of query performed (see PHAsset fetchAssetsWithOptions:)
|
|
31
|
+
@property (nonatomic, assign) PHAssetSourceType includeAssetSourceTypes API_AVAILABLE(ios(9));
|
|
32
|
+
|
|
33
|
+
// Limits the maximum number of objects returned in the fetch result, a value of 0 means no limit. Defaults to 0.
|
|
34
|
+
@property (nonatomic, assign, readwrite) NSUInteger fetchLimit API_AVAILABLE(ios(9));
|
|
35
|
+
|
|
36
|
+
// Whether the owner of this object is interested in incremental change details for the results of this fetch (see PHChange)
|
|
37
|
+
// Defaults to YES
|
|
38
|
+
@property (nonatomic, assign) BOOL wantsIncrementalChangeDetails;
|
|
39
|
+
|
|
40
|
+
/// A Boolean value to fetch `PHAssetExtendedMetadata` when the asset is also fetched.
|
|
41
|
+
///
|
|
42
|
+
/// By default `extendedMetadata` is fetched on demand, with the dot accessor. Prefetching will fetch it as part of the `PHAsset` in a single fetch, rather than incurring fetch overhead for each `PHAsset`.
|
|
43
|
+
@property (nonatomic, assign) BOOL prefetchAssetExtendedMetadata API_AVAILABLE(macos(27), ios(27), tvos(27), visionos(27));
|
|
44
|
+
|
|
45
|
+
@end
|
|
46
|
+
|
|
47
|
+
API_AVAILABLE_END
|
|
48
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHFetchResult.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2013 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <Photos/PhotosTypes.h>
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
API_AVAILABLE_BEGIN(macos(10.13), ios(8), tvos(10))
|
|
13
|
+
|
|
14
|
+
// Accessing fetched results (fetches objects from the backing store in chunks on demand rather than all at once)
|
|
15
|
+
// Fetched objects will be kept in a cache and purged under memory pressure
|
|
16
|
+
OS_EXPORT
|
|
17
|
+
NS_SWIFT_SENDABLE
|
|
18
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface PHFetchResult<__covariant ObjectType> : NSObject <NSCopying, NSFastEnumeration>
|
|
19
|
+
|
|
20
|
+
@property (readonly) NSUInteger count;
|
|
21
|
+
- (ObjectType)objectAtIndex:(NSUInteger)index;
|
|
22
|
+
- (ObjectType)objectAtIndexedSubscript:(NSUInteger)idx;
|
|
23
|
+
|
|
24
|
+
- (BOOL)containsObject:(ObjectType)anObject;
|
|
25
|
+
|
|
26
|
+
- (NSUInteger)indexOfObject:(ObjectType)anObject;
|
|
27
|
+
- (NSUInteger)indexOfObject:(ObjectType)anObject inRange:(NSRange)range;
|
|
28
|
+
|
|
29
|
+
@property (nonatomic, readonly, nullable) ObjectType firstObject;
|
|
30
|
+
@property (nonatomic, readonly, nullable) ObjectType lastObject;
|
|
31
|
+
|
|
32
|
+
- (NSArray<ObjectType> *)objectsAtIndexes:(NSIndexSet *)indexes;
|
|
33
|
+
|
|
34
|
+
- (void)enumerateObjectsUsingBlock:(void (^)(ObjectType obj, NSUInteger idx, BOOL *stop))block;
|
|
35
|
+
- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (^)(ObjectType obj, NSUInteger idx, BOOL *stop))block;
|
|
36
|
+
- (void)enumerateObjectsAtIndexes:(NSIndexSet *)s options:(NSEnumerationOptions)opts usingBlock:(void (^)(ObjectType obj, NSUInteger idx, BOOL *stop))block;
|
|
37
|
+
|
|
38
|
+
- (NSUInteger)countOfAssetsWithMediaType:(PHAssetMediaType)mediaType;
|
|
39
|
+
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
API_AVAILABLE_END
|
|
43
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHImageManager.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2013-2014 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <TargetConditionals.h>
|
|
9
|
+
#import <AVFoundation/AVFoundation.h>
|
|
10
|
+
#import <Photos/PhotosTypes.h>
|
|
11
|
+
#import <ImageIO/CGImageProperties.h>
|
|
12
|
+
|
|
13
|
+
@class UIImage;
|
|
14
|
+
@class PHAsset;
|
|
15
|
+
@class PHLivePhoto;
|
|
16
|
+
|
|
17
|
+
#if defined(__cplusplus) && __cplusplus < 201103L
|
|
18
|
+
#error "Photos requires C++11 or later"
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
typedef NS_ENUM(NSInteger, UIImageOrientation);
|
|
22
|
+
|
|
23
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
24
|
+
API_AVAILABLE_BEGIN(macos(10.13), ios(8), tvos(10))
|
|
25
|
+
|
|
26
|
+
#pragma mark - PHImageRequestOptions - Configuration
|
|
27
|
+
|
|
28
|
+
typedef NS_ENUM(NSInteger, PHImageRequestOptionsVersion) {
|
|
29
|
+
PHImageRequestOptionsVersionCurrent = 0, // version with edits (aka adjustments) rendered or unadjusted version if there is no edits
|
|
30
|
+
PHImageRequestOptionsVersionUnadjusted, // original version without any adjustments
|
|
31
|
+
PHImageRequestOptionsVersionOriginal // original version, in the case of a combined format the highest fidelity format will be returned (e.g. RAW for a RAW+JPG source image)
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
typedef NS_ENUM(NSInteger, PHImageRequestOptionsDeliveryMode) {
|
|
35
|
+
PHImageRequestOptionsDeliveryModeOpportunistic = 0, // client may get several image results when the call is asynchronous or will get one result when the call is synchronous
|
|
36
|
+
PHImageRequestOptionsDeliveryModeHighQualityFormat = 1, // client will get one result only and it will be as asked or better than asked
|
|
37
|
+
PHImageRequestOptionsDeliveryModeFastFormat = 2 // client will get one result only and it may be degraded
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
typedef NS_ENUM(NSInteger, PHImageRequestOptionsResizeMode) {
|
|
41
|
+
PHImageRequestOptionsResizeModeNone = 0, // no resize
|
|
42
|
+
PHImageRequestOptionsResizeModeFast, // use targetSize as a hint for optimal decoding when the source image is a compressed format (i.e. subsampling), the delivered image may be larger than targetSize
|
|
43
|
+
PHImageRequestOptionsResizeModeExact, // same as above but also guarantees the delivered image is exactly targetSize (must be set when a normalizedCropRect is specified)
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// Progress handler, called in an arbitrary serial queue. Only called when the data is not available locally and is retrieved from iCloud.
|
|
47
|
+
typedef void (^PHAssetImageProgressHandler)(double progress, NSError *__nullable error, BOOL *stop, NSDictionary *__nullable info);
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
#pragma mark -
|
|
51
|
+
OS_EXPORT
|
|
52
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface PHImageRequestOptions : NSObject <NSCopying>
|
|
53
|
+
|
|
54
|
+
@property (nonatomic, assign) PHImageRequestOptionsVersion version; // version
|
|
55
|
+
@property (nonatomic, assign) PHImageRequestOptionsDeliveryMode deliveryMode; // delivery mode. Defaults to PHImageRequestOptionsDeliveryModeOpportunistic
|
|
56
|
+
@property (nonatomic, assign) PHImageRequestOptionsResizeMode resizeMode; // resize mode. Does not apply when size is PHImageManagerMaximumSize. Defaults to PHImageRequestOptionsResizeModeFast
|
|
57
|
+
@property (nonatomic, assign) CGRect normalizedCropRect; // specify crop rectangle in unit coordinates of the original image, such as a face. Defaults to CGRectZero (not applicable)
|
|
58
|
+
@property (nonatomic, assign, getter=isNetworkAccessAllowed) BOOL networkAccessAllowed; // if necessary will download the image from iCloud (client can monitor or cancel using progressHandler). Defaults to NO (see start/stopCachingImagesForAssets)
|
|
59
|
+
@property (nonatomic, assign, getter=isSynchronous) BOOL synchronous; // return only a single result, blocking until available (or failure). Defaults to NO
|
|
60
|
+
@property (nonatomic, copy, nullable) PHAssetImageProgressHandler progressHandler; // provide caller a way to be told how much progress has been made prior to delivering the data when it comes from iCloud. Defaults to nil, shall be set by caller
|
|
61
|
+
@property (nonatomic) BOOL allowSecondaryDegradedImage API_AVAILABLE(macos(14), ios(17), tvos(17)); // in addition to the initial degraded result, an additional degraded result will be returned if conditions permit
|
|
62
|
+
|
|
63
|
+
/// Request HDR image data if available (such as PQ/HLG formats).
|
|
64
|
+
///
|
|
65
|
+
/// When set to `YES`, the image manager will attempt to provide HDR image data if the asset contains HDR content.
|
|
66
|
+
/// Defaults to `NO`.
|
|
67
|
+
@property (nonatomic, assign) BOOL preferHDR API_AVAILABLE(macos(14), ios(17), tvos(17), visionos(1));
|
|
68
|
+
|
|
69
|
+
/// Target HDR headroom for image rendering.
|
|
70
|
+
///
|
|
71
|
+
/// Specifies the target headroom value for HDR image rendering. Headroom represents the ratio between
|
|
72
|
+
/// the maximum display brightness and standard dynamic range (SDR) white level.
|
|
73
|
+
///
|
|
74
|
+
/// - A headroom value of `0.0` means "headroom unknown". Images with unknown content headroom will be
|
|
75
|
+
/// excluded from tone mapping, following CGImage documentation behavior.
|
|
76
|
+
/// - Headroom values less than `0.0` or between `0.0` and `1.0` (exclusive) are undefined and will be
|
|
77
|
+
/// clamped to `0.0` (unknown) rather than throwing an error.
|
|
78
|
+
/// - Headroom is dependent on the current display capabilities. It is the responsibility of the caller
|
|
79
|
+
/// to re-request the image if the display's headroom characteristics change. Swift view default behavior
|
|
80
|
+
/// applies to views that use images outside of the current display headroom supported range.
|
|
81
|
+
///
|
|
82
|
+
/// Defaults to `1.0` (SDR, fully tone mapped).
|
|
83
|
+
@property (nonatomic, assign) CGFloat targetHDRHeadroom API_AVAILABLE(macos(14), ios(17), tvos(17), visionos(1));
|
|
84
|
+
|
|
85
|
+
@end
|
|
86
|
+
|
|
87
|
+
API_AVAILABLE_END // macos(10.13), ios(8), tvos(10)
|
|
88
|
+
API_AVAILABLE_BEGIN(macos(10.15), ios(9.1), tvos(10))
|
|
89
|
+
|
|
90
|
+
#pragma mark -
|
|
91
|
+
OS_EXPORT
|
|
92
|
+
@interface PHLivePhotoRequestOptions : NSObject <NSCopying>
|
|
93
|
+
|
|
94
|
+
@property (nonatomic, assign) PHImageRequestOptionsVersion version; // version
|
|
95
|
+
@property (nonatomic, assign) PHImageRequestOptionsDeliveryMode deliveryMode;
|
|
96
|
+
@property (nonatomic, assign, getter=isNetworkAccessAllowed) BOOL networkAccessAllowed;
|
|
97
|
+
@property (nonatomic, copy, nullable) PHAssetImageProgressHandler progressHandler;
|
|
98
|
+
|
|
99
|
+
/// Request HDR image data if available (such as PQ/HLG formats).
|
|
100
|
+
///
|
|
101
|
+
/// Off by default. For best results, only enable this when you intend to display an HDR experience in
|
|
102
|
+
/// `PHLivePhotoView` — for example, when the view's `preferredImageDynamicRange` is greater than
|
|
103
|
+
/// standard (SDR).
|
|
104
|
+
/// Defaults to `NO`.
|
|
105
|
+
@property (nonatomic) BOOL preferHDR API_AVAILABLE(macos(14), ios(17), tvos(17), visionos(1));
|
|
106
|
+
|
|
107
|
+
@end
|
|
108
|
+
|
|
109
|
+
API_AVAILABLE_END // macos(10.15), ios(9.1), tvos(10)
|
|
110
|
+
API_AVAILABLE_BEGIN(ios(8), tvos(10))
|
|
111
|
+
API_AVAILABLE_BEGIN(macos(10.15))
|
|
112
|
+
|
|
113
|
+
#pragma mark - PHVideoRequestOptions - Configuration
|
|
114
|
+
|
|
115
|
+
typedef NS_ENUM(NSInteger, PHVideoRequestOptionsVersion) {
|
|
116
|
+
PHVideoRequestOptionsVersionCurrent = 0, // version with edits (aka adjustments) rendered or unadjusted version if there is no edits
|
|
117
|
+
PHVideoRequestOptionsVersionOriginal // original version
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
typedef NS_ENUM(NSInteger, PHVideoRequestOptionsDeliveryMode) { // only apply with PHVideoRequestOptionsVersionCurrent
|
|
121
|
+
PHVideoRequestOptionsDeliveryModeAutomatic = 0, // let us pick the quality (typ. PHVideoRequestOptionsDeliveryModeMediumQualityFormat for streamed AVPlayerItem or AVAsset, or PHVideoRequestOptionsDeliveryModeHighQualityFormat for AVAssetExportSession)
|
|
122
|
+
PHVideoRequestOptionsDeliveryModeHighQualityFormat = 1, // best quality
|
|
123
|
+
PHVideoRequestOptionsDeliveryModeMediumQualityFormat = 2, // medium quality (typ. 720p), currently only supported for AVPlayerItem or AVAsset when streaming from iCloud (will systematically default to PHVideoRequestOptionsDeliveryModeHighQualityFormat if locally available)
|
|
124
|
+
PHVideoRequestOptionsDeliveryModeFastFormat = 3 // fastest available (typ. 360p MP4), currently only supported for AVPlayerItem or AVAsset when streaming from iCloud (will systematically default to PHVideoRequestOptionsDeliveryModeHighQualityFormat if locally available)
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// Progress handler, called in an arbitrary serial queue: only called when the data is not available locally and is retrieved from iCloud
|
|
128
|
+
typedef void (^PHAssetVideoProgressHandler)(double progress, NSError *__nullable error, BOOL *stop, NSDictionary *__nullable info);
|
|
129
|
+
|
|
130
|
+
OS_EXPORT
|
|
131
|
+
@interface PHVideoRequestOptions : NSObject <NSCopying>
|
|
132
|
+
|
|
133
|
+
@property (nonatomic, assign, getter=isNetworkAccessAllowed) BOOL networkAccessAllowed;
|
|
134
|
+
@property (nonatomic, assign) PHVideoRequestOptionsVersion version;
|
|
135
|
+
@property (nonatomic, assign) PHVideoRequestOptionsDeliveryMode deliveryMode;
|
|
136
|
+
@property (nonatomic, copy, nullable) PHAssetVideoProgressHandler progressHandler;
|
|
137
|
+
|
|
138
|
+
@end
|
|
139
|
+
|
|
140
|
+
API_AVAILABLE_END // macos(10.15)
|
|
141
|
+
API_AVAILABLE_BEGIN(macos(10.13))
|
|
142
|
+
|
|
143
|
+
#pragma mark - PHImageManager - Fetching
|
|
144
|
+
|
|
145
|
+
// Uniquely identify a cancellable async request
|
|
146
|
+
typedef int32_t PHImageRequestID;
|
|
147
|
+
static const PHImageRequestID PHInvalidImageRequestID = 0;
|
|
148
|
+
|
|
149
|
+
// Size to pass when requesting the original image or the largest rendered image available (resizeMode will be ignored)
|
|
150
|
+
extern CGSize const PHImageManagerMaximumSize;
|
|
151
|
+
|
|
152
|
+
// Result's handler info dictionary keys
|
|
153
|
+
extern NSString *const PHImageResultIsInCloudKey; // key (NSNumber): result is in iCloud, meaning a new request will need to get issued (with networkAccessAllowed set) to get the result
|
|
154
|
+
extern NSString *const PHImageResultIsDegradedKey; // key (NSNumber): result is a degraded image (only with async requests), meaning other images will be sent unless the request is cancelled in the meanwhile (note that the other request may fail if, for example, data is not available locally and networkAccessAllowed was not specified)
|
|
155
|
+
extern NSString *const PHImageResultRequestIDKey; // key (NSNumber): Request ID of the request for this result
|
|
156
|
+
extern NSString *const PHImageCancelledKey; // key (NSNumber): result is not available because the request was cancelled
|
|
157
|
+
extern NSString *const PHImageErrorKey; // key (NSError): NSFileManager or iCloud Photo Library errors
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
// Note that all sizes are in pixels
|
|
161
|
+
OS_EXPORT
|
|
162
|
+
NS_SWIFT_SENDABLE
|
|
163
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface PHImageManager : NSObject
|
|
164
|
+
|
|
165
|
+
+ (PHImageManager *)defaultManager;
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
#pragma mark - Image
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
@abstract Request an image representation for the specified asset.
|
|
172
|
+
@param asset The asset whose image data is to be loaded.
|
|
173
|
+
@param targetSize The target size of image to be returned.
|
|
174
|
+
@param contentMode An option for how to fit the image to the aspect ratio of the requested size.
|
|
175
|
+
If the asset's aspect ratio does not match that of the given targetSize, contentMode determines how the image will be resized.
|
|
176
|
+
PHImageContentModeAspectFit: Fit the asked size by maintaining the aspect ratio, the delivered image may not necessarily be the asked targetSize (see PHImageRequestOptionsDeliveryMode and PHImageRequestOptionsResizeMode)
|
|
177
|
+
PHImageContentModeAspectFill: Fill the asked size, some portion of the content may be clipped, the delivered image may not necessarily be the asked targetSize (see PHImageRequestOptionsDeliveryMode and PHImageRequestOptionsResizeMode)
|
|
178
|
+
PHImageContentModeDefault: Use PHImageContentModeDefault when size is PHImageManagerMaximumSize (though no scaling/cropping will be done on the result)
|
|
179
|
+
@param options Options specifying how Photos should handle the request, format the requested image, and notify your app of progress or errors.
|
|
180
|
+
If -[PHImageRequestOptions isSynchronous] returns NO (or options is nil), resultHandler may be called 1 or more times. Typically in this case, resultHandler will be called asynchronously on the main thread with the requested results. However, if deliveryMode = PHImageRequestOptionsDeliveryModeOpportunistic, resultHandler may be called synchronously on the calling thread if any image data is immediately available. If the image data returned in this first pass is of insufficient quality, resultHandler will be called again, asychronously on the main thread at a later time with the "correct" results. If the request is cancelled, resultHandler may not be called at all.
|
|
181
|
+
If -[PHImageRequestOptions isSynchronous] returns YES, resultHandler will be called exactly once, synchronously and on the calling thread. Synchronous requests cannot be cancelled.
|
|
182
|
+
@param resultHandler A block that is called one or more times either synchronously on the current thread or asynchronously on the main thread depending on the options specified in the PHImageRequestOptions options parameter.
|
|
183
|
+
@return A numeric identifier for the request. If you need to cancel the request before it completes, pass this identifier to the cancelImageRequest: method.
|
|
184
|
+
*/
|
|
185
|
+
- (PHImageRequestID)requestImageForAsset:(PHAsset *)asset targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(nullable PHImageRequestOptions *)options resultHandler:(void (^)(UIImage *_Nullable result, NSDictionary *_Nullable info))resultHandler;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
@abstract Request largest represented image as data bytes for the specified asset.
|
|
189
|
+
@param asset The asset whose image data is to be loaded.
|
|
190
|
+
@param options Options specifying how Photos should handle the request, format the requested image, and notify your app of progress or errors.
|
|
191
|
+
If PHImageRequestOptionsVersionCurrent is requested and the asset has adjustments then the largest rendered image data is returned. In all other cases then the original image data is returned.
|
|
192
|
+
@param resultHandler A block that is called exactly once either synchronously on the current thread or asynchronously on the main thread depending on the synchronous option specified in the PHImageRequestOptions options parameter (deliveryMode is ignored).
|
|
193
|
+
*/
|
|
194
|
+
|
|
195
|
+
- (PHImageRequestID)requestImageDataForAsset:(PHAsset *)asset options:(nullable PHImageRequestOptions *)options resultHandler:(void (^)(NSData *_Nullable imageData, NSString *_Nullable dataUTI, UIImageOrientation orientation, NSDictionary *_Nullable info))resultHandler API_DEPRECATED_WITH_REPLACEMENT("-requestImageDataAndOrientationForAsset:options:resultHandler:", ios(8, 13), tvos(8, 13)) API_UNAVAILABLE(macos);
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
@abstract Request largest represented image as data bytes and EXIF orientation for the specified asset.
|
|
200
|
+
@param asset The asset whose image data is to be loaded.
|
|
201
|
+
@param options Options specifying how Photos should handle the request, format the requested image, and notify your app of progress or errors.
|
|
202
|
+
If PHImageRequestOptionsVersionCurrent is requested and the asset has adjustments then the largest rendered image data is returned. In all other cases then the original image data is returned.
|
|
203
|
+
@param resultHandler A block that is called exactly once either synchronously on the current thread or asynchronously on the main thread depending on the synchronous option specified in the PHImageRequestOptions options parameter (deliveryMode is ignored). Orientation is an EXIF orientation as an CGImagePropertyOrientation. For iOS or tvOS, convert this to an UIImageOrientation.
|
|
204
|
+
*/
|
|
205
|
+
- (PHImageRequestID)requestImageDataAndOrientationForAsset:(PHAsset *)asset options:(nullable PHImageRequestOptions *)options resultHandler:(void (^)(NSData *_Nullable imageData, NSString *_Nullable dataUTI, CGImagePropertyOrientation orientation, NSDictionary *_Nullable info))resultHandler API_AVAILABLE(macos(10.15), ios(13), tvos(13));
|
|
206
|
+
|
|
207
|
+
- (void)cancelImageRequest:(PHImageRequestID)requestID;
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
#pragma mark - Live Photo
|
|
211
|
+
|
|
212
|
+
/// Requests a live photo representation of the asset. With PHImageRequestOptionsDeliveryModeOpportunistic (or if no options are specified), the resultHandler block may be called more than once (the first call may occur before the method returns). The PHImageResultIsDegradedKey key in the result handler's info parameter indicates when a temporary low-quality live photo is provided.
|
|
213
|
+
- (PHImageRequestID)requestLivePhotoForAsset:(PHAsset *)asset targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(nullable PHLivePhotoRequestOptions *)options resultHandler:(void (^)(PHLivePhoto *__nullable livePhoto, NSDictionary *__nullable info))resultHandler API_AVAILABLE(macos(10.15), ios(9.1));
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
#pragma mark - Video
|
|
217
|
+
|
|
218
|
+
// Playback only. The result handler is called on an arbitrary queue.
|
|
219
|
+
- (PHImageRequestID)requestPlayerItemForVideo:(PHAsset *)asset options:(nullable PHVideoRequestOptions *)options resultHandler:(void (^)(AVPlayerItem *__nullable playerItem, NSDictionary *__nullable info))resultHandler API_AVAILABLE(macos(10.15));
|
|
220
|
+
|
|
221
|
+
// Export. The result handler is called on an arbitrary queue.
|
|
222
|
+
- (PHImageRequestID)requestExportSessionForVideo:(PHAsset *)asset options:(nullable PHVideoRequestOptions *)options exportPreset:(NSString *)exportPreset resultHandler:(void (^)(AVAssetExportSession *__nullable exportSession, NSDictionary *__nullable info))resultHandler API_AVAILABLE(macos(10.15));
|
|
223
|
+
|
|
224
|
+
// Everything else. The result handler is called on an arbitrary queue.
|
|
225
|
+
- (PHImageRequestID)requestAVAssetForVideo:(PHAsset *)asset options:(nullable PHVideoRequestOptions *)options resultHandler:(void (^)(AVAsset *__nullable asset, AVAudioMix *__nullable audioMix, NSDictionary *__nullable info))resultHandler API_AVAILABLE(macos(10.15));
|
|
226
|
+
|
|
227
|
+
@end
|
|
228
|
+
|
|
229
|
+
API_AVAILABLE_END // macos(10.13)
|
|
230
|
+
API_AVAILABLE_BEGIN(macos(10.15))
|
|
231
|
+
|
|
232
|
+
#pragma mark - PHCachingImageManager - Preheating
|
|
233
|
+
|
|
234
|
+
OS_EXPORT
|
|
235
|
+
NS_SWIFT_SENDABLE
|
|
236
|
+
@interface PHCachingImageManager : PHImageManager
|
|
237
|
+
|
|
238
|
+
@property (nonatomic, assign) BOOL allowsCachingHighQualityImages API_DEPRECATED("This property is unused and will be removed in a future release", ios(8, 26.0), tvos(10, 26.0), macos(10.15, 26.0), visionos(1, 26.0));
|
|
239
|
+
|
|
240
|
+
// Asynchronous image preheating (aka caching), note that only image sources are cached (no crop or exact resize is ever done on them at the time of caching, only at the time of delivery when applicable).
|
|
241
|
+
// The options values shall exactly match the options values used in loading methods. If two or more caching requests are done on the same asset using different options or different targetSize the first
|
|
242
|
+
// caching request will have precedence (until it is stopped)
|
|
243
|
+
- (void)startCachingImagesForAssets:(NSArray<PHAsset *> *)assets targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(nullable PHImageRequestOptions *)options;
|
|
244
|
+
- (void)stopCachingImagesForAssets:(NSArray<PHAsset *> *)assets targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(nullable PHImageRequestOptions *)options;
|
|
245
|
+
- (void)stopCachingImagesForAllAssets;
|
|
246
|
+
|
|
247
|
+
@end
|
|
248
|
+
|
|
249
|
+
API_AVAILABLE_END // macos(10.15)
|
|
250
|
+
API_AVAILABLE_END // ios(8), tvos(10)
|
|
251
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PHLivePhoto.h
|
|
3
|
+
// Photos
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2015 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Photos/PhotosTypes.h>
|
|
9
|
+
#import <CoreGraphics/CGGeometry.h>
|
|
10
|
+
@class UIImage;
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
API_AVAILABLE_BEGIN(macos(10.15), ios(9.1), tvos(10))
|
|
14
|
+
|
|
15
|
+
typedef int32_t PHLivePhotoRequestID;
|
|
16
|
+
static const PHLivePhotoRequestID PHLivePhotoRequestIDInvalid = 0;
|
|
17
|
+
|
|
18
|
+
/// These keys may be found in the info dictionary delivered to a live photo request result handler block.
|
|
19
|
+
extern NSString * const PHLivePhotoInfoErrorKey; // key : NSError decribing an error that has occurred while creating the live photo
|
|
20
|
+
extern NSString * const PHLivePhotoInfoIsDegradedKey; // key : NSNumber containing a BOOL, YES whenever the deivered live photo object does not contain all content required for full playback.
|
|
21
|
+
extern NSString * const PHLivePhotoInfoCancelledKey; // key : NSNumber containing a BOOL, YES when the result handler is being called after the request has been cancelled.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
OS_EXPORT API_AVAILABLE(macos(10.12))
|
|
25
|
+
NS_SWIFT_SENDABLE
|
|
26
|
+
@interface PHLivePhoto : NSObject <NSCopying, NSSecureCoding>
|
|
27
|
+
|
|
28
|
+
- (instancetype)init NS_UNAVAILABLE;
|
|
29
|
+
|
|
30
|
+
/// The dimensions of the live photo measured in pixels.
|
|
31
|
+
@property (readonly, nonatomic) CGSize size API_AVAILABLE(macos(10.12));
|
|
32
|
+
|
|
33
|
+
#pragma mark - Export
|
|
34
|
+
|
|
35
|
+
/// Requests a Live Photo from the given resource URLs. The result handler will be called multiple times to deliver new PHLivePhoto instances with increasingly more content. If a placeholder image is provided, the result handler will first be invoked synchronously to deliver a live photo containing only the placeholder image. Subsequent invocations of the result handler will occur on the main queue.
|
|
36
|
+
// The targetSize and contentMode parameters are used to resize the live photo content if needed. If targetSize is equal to CGRectZero, content will not be resized.
|
|
37
|
+
// When using this method to provide content for a PHLivePhotoView, each live photo instance delivered via the result handler should be passed to -[PHLivePhotoView setLivePhoto:].
|
|
38
|
+
+ (PHLivePhotoRequestID)requestLivePhotoWithResourceFileURLs:(NSArray<NSURL *> *)fileURLs placeholderImage:(nullable UIImage *)image targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode resultHandler:(void(^)(PHLivePhoto *_Nullable livePhoto, NSDictionary *info))resultHandler;
|
|
39
|
+
|
|
40
|
+
/// Cancels the loading of a PHLivePhoto. The request's completion handler will be called.
|
|
41
|
+
+ (void)cancelLivePhotoRequestWithRequestID:(PHLivePhotoRequestID)requestID;
|
|
42
|
+
|
|
43
|
+
@end
|
|
44
|
+
|
|
45
|
+
API_AVAILABLE(ios(14))
|
|
46
|
+
API_UNAVAILABLE(macos, tvos, watchos)
|
|
47
|
+
@interface PHLivePhoto (NSItemProvider) <NSItemProviderReading>
|
|
48
|
+
|
|
49
|
+
@end
|
|
50
|
+
|
|
51
|
+
API_AVAILABLE_END
|
|
52
|
+
NS_ASSUME_NONNULL_END
|