Skip to content

Photos tvOS xcode14.0 beta1

Manuel de la Pena edited this page Aug 5, 2022 · 3 revisions

#Photos.framework https://github.com/xamarin/xamarin-macios/pull/15608

diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAsset.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAsset.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAsset.h	2022-02-23 07:10:33.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAsset.h	2022-05-31 14:50:05.000000000 -0400
@@ -55,6 +55,7 @@
 
 @property (nonatomic, assign, readonly) PHAssetSourceType sourceType API_AVAILABLE(ios(9));
 
+@property (nonatomic, assign, readonly) BOOL hasAdjustments API_AVAILABLE(macos(12), ios(15), tvos(15));
 // only applies to adjusted assets
 @property (nonatomic, assign, readonly, nullable) NSString *adjustmentFormatIdentifier API_AVAILABLE(macos(12), ios(15), tvos(15));
 
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResource.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResource.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResource.h	2022-02-23 07:10:35.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHAssetResource.h	2022-06-03 18:07:29.000000000 -0400
@@ -21,6 +21,9 @@
 @property (nonatomic, copy, readonly) NSString *uniformTypeIdentifier;
 @property (nonatomic, copy, readonly) NSString *originalFilename;
 
+@property (nonatomic, assign, readonly) NSInteger pixelWidth API_AVAILABLE(macos(13), ios(16), tvos(16));
+@property (nonatomic, assign, readonly) NSInteger pixelHeight API_AVAILABLE(macos(13), ios(16), tvos(16));
+
 #pragma mark - Getting resources
 
 + (NSArray<PHAssetResource *> *)assetResourcesForAsset:(PHAsset *)asset;
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHCollection.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHCollection.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHCollection.h	2022-02-23 07:13:32.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHCollection.h	2022-05-31 15:04:06.000000000 -0400
@@ -64,7 +64,7 @@
 + (PHFetchResult<PHAssetCollection *> *)fetchAssetCollectionsContainingAsset:(PHAsset *)asset withType:(PHAssetCollectionType)type options:(nullable PHFetchOptions *)options;
 
 // assetGroupURLs are URLs retrieved from ALAssetGroup's ALAssetsGroupPropertyURL
-+ (PHFetchResult<PHAssetCollection *> *)fetchAssetCollectionsWithALAssetGroupURLs:(NSArray<NSURL *> *)assetGroupURLs options:(nullable PHFetchOptions *)options;
++ (PHFetchResult<PHAssetCollection *> *)fetchAssetCollectionsWithALAssetGroupURLs:(NSArray<NSURL *> *)assetGroupURLs options:(nullable PHFetchOptions *)options API_DEPRECATED("Will be removed in a future release", ios(8,16), tvos(10,16), macos(10.15,13));
 
 
 #pragma mark - Fetching moment asset collections (Deprecated)
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHError.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHError.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHError.h	2022-02-23 07:56:49.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHError.h	2022-05-31 14:50:06.000000000 -0400
@@ -22,6 +22,7 @@
     PHPhotosErrorRelinquishingLibraryBundleToWriter = 3142, // The photo library became unavailable because the user moved, renamed, or deleted the system photo library (register for PHPhotoLibraryAvailabilityObserver)
     PHPhotosErrorSwitchingSystemPhotoLibrary = 3143, // The photo library became unavailable because the user switched the system photo library (register for PHPhotoLibraryAvailabilityObserver)
     PHPhotosErrorNetworkAccessRequired API_AVAILABLE(macos(11.0), ios(14), tvos(14)) = 3164, // The request for an asset resource failed because network access is required, set networkAccessAllowed = YES to enable network access
+    PHPhotosErrorNetworkError API_AVAILABLE(macos(13), ios(16), tvos(16)) = 3169, // The request for an asset resource failed due to a network connection error
     PHPhotosErrorIdentifierNotFound API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3201, // Identifier was not found
     PHPhotosErrorMultipleIdentifiersFound API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3202, // More than one identifier was found
 
@@ -36,6 +37,9 @@
     PHPhotosErrorAccessUserDenied API_AVAILABLE(macos(12), ios(15), tvos(15)) = 3311, // The user has denied access
 
     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
+    
+    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
+    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
 
     PHPhotosErrorInvalid API_DEPRECATED_WITH_REPLACEMENT("PHPhotosErrorInternalError", macos(10.15, 12), ios(13, 15), tvos(13, 15)) = -1, // DEPRECATED An unknown error occured
 };
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChange.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChange.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChange.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChange.h	2022-06-03 18:07:28.000000000 -0400
@@ -0,0 +1,28 @@
+//
+//  PHPersistentChange.h
+//  Photos
+//
+//  Copyright © 2022 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <Photos/PhotosTypes.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class PHPersistentChangeToken;
+@class PHPersistentObjectChangeDetails;
+
+API_AVAILABLE(macosx(13), ios(16), tvos(16))
+@interface PHPersistentChange : NSObject
+
++ (instancetype)new NS_UNAVAILABLE;
+- (instancetype)init NS_UNAVAILABLE;
+
+@property (nonatomic, readonly) PHPersistentChangeToken *changeToken;
+
+- (nullable PHPersistentObjectChangeDetails *)changeDetailsForObjectType:(PHObjectType)objectType error:(NSError **)error;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChangeFetchResult.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChangeFetchResult.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChangeFetchResult.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChangeFetchResult.h	2022-06-03 18:07:28.000000000 -0400
@@ -0,0 +1,26 @@
+//
+//  Created by Dave Dribin on 2/9/18.
+//  Copyright © 2018 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class PHChange;
+@class PHPersistentChange;
+@class PHPersistentChangeToken;
+
+
+API_AVAILABLE(macos(13), ios(16), tvos(16))
+
+@interface PHPersistentChangeFetchResult : NSObject
+
++ (instancetype)new NS_UNAVAILABLE;
+- (instancetype)init NS_UNAVAILABLE;
+
+- (void)enumerateChangesWithBlock:(void (NS_NOESCAPE ^)(PHPersistentChange *change, BOOL *stop))block NS_REFINED_FOR_SWIFT;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChangeToken.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChangeToken.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChangeToken.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentChangeToken.h	2022-06-03 18:07:28.000000000 -0400
@@ -0,0 +1,20 @@
+//
+//  Created by Dave Dribin on 11/2/17.
+//  Copyright © 2017 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+
+API_AVAILABLE(macos(13), ios(16), tvos(16))
+
+@interface PHPersistentChangeToken : NSObject <NSCopying, NSSecureCoding>
+
++ (instancetype)new NS_UNAVAILABLE;
+- (instancetype)init NS_UNAVAILABLE;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentObjectChangeDetails.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentObjectChangeDetails.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentObjectChangeDetails.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPersistentObjectChangeDetails.h	2022-06-03 18:07:28.000000000 -0400
@@ -0,0 +1,29 @@
+//
+//  PHPersistentObjectChangeDetails.h
+//  Photos
+//
+//  Copyright © 2022 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <Photos/PhotosTypes.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class PHObject;
+
+API_AVAILABLE(macosx(13), ios(16), tvos(16))
+@interface PHPersistentObjectChangeDetails : NSObject
+
+@property (nonatomic, readonly) PHObjectType objectType;
+
+@property (nonatomic, strong, readonly) NSSet<NSString *> *insertedLocalIdentifiers;
+@property (nonatomic, strong, readonly) NSSet<NSString *> *updatedLocalIdentifiers;
+@property (nonatomic, strong, readonly) NSSet<NSString *> *deletedLocalIdentifiers;
+
++ (instancetype)new NS_UNAVAILABLE;
+- (instancetype)init NS_UNAVAILABLE;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h	2022-02-23 10:57:59.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h	2022-06-03 18:09:46.000000000 -0400
@@ -13,6 +13,8 @@
 
 @class PHChange;
 @class PHPhotoLibrary;
+@class PHPersistentChangeToken;
+@class PHPersistentChangeFetchResult;
 
 typedef NS_ENUM(NSInteger, PHAuthorizationStatus) {
     PHAuthorizationStatusNotDetermined = 0, // User has not yet made a choice with regards to this application
@@ -84,6 +86,12 @@
 - (void)registerChangeObserver:(id<PHPhotoLibraryChangeObserver>)observer;
 - (void)unregisterChangeObserver:(id<PHPhotoLibraryChangeObserver>)observer;
 
+#pragma mark - Change History
+
+- (nullable PHPersistentChangeFetchResult *)fetchPersistentChangesSinceToken:(PHPersistentChangeToken *)token error:(NSError **)error API_AVAILABLE(macos(13), ios(16), tvos(16));
+
+@property (nonatomic, readonly) PHPersistentChangeToken *currentChangeToken API_AVAILABLE(macos(13), ios(16), tvos(16));
+
 @end
 
 API_AVAILABLE_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.h	2022-02-15 22:10:27.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.h	2022-05-25 22:07:48.000000000 -0400
@@ -21,6 +21,10 @@
 #import <Photos/PHFetchResult.h>
 
 #import <Photos/PHChange.h>
+#import <Photos/PHPersistentChange.h>
+#import <Photos/PHPersistentChangeToken.h>
+#import <Photos/PHPersistentChangeFetchResult.h>
+#import <Photos/PHPersistentObjectChangeDetails.h>
 
 #import <Photos/PHAssetChangeRequest.h>
 #import <Photos/PHAssetCreationRequest.h>
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h	2022-02-23 07:10:34.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/Photos.framework/Headers/PhotosTypes.h	2022-05-31 15:04:06.000000000 -0400
@@ -100,6 +100,8 @@
     PHAssetCollectionSubtypeSmartAlbumLongExposures API_AVAILABLE(macos(10.15), ios(11), tvos(11)) = 215,
     PHAssetCollectionSubtypeSmartAlbumUnableToUpload API_AVAILABLE(macos(10.15), ios(13), tvos(13)) = 216,
     PHAssetCollectionSubtypeSmartAlbumRAW API_AVAILABLE(macos(12), ios(15), tvos(15)) = 217,
+    PHAssetCollectionSubtypeSmartAlbumCinematic API_AVAILABLE(macos(12), ios(15), tvos(15)) = 218,
+
 
     // Used for fetching, if you don't care about the exact subtype
     PHAssetCollectionSubtypeAny = NSIntegerMax
@@ -144,6 +146,7 @@
     PHAssetMediaSubtypeVideoStreamed      = (1UL << 16),
     PHAssetMediaSubtypeVideoHighFrameRate = (1UL << 17),
     PHAssetMediaSubtypeVideoTimelapse     = (1UL << 18),
+    PHAssetMediaSubtypeVideoCinematic API_AVAILABLE(macos(12), ios(15), tvos(15)) = (1UL << 21),
 };
 
 typedef NS_OPTIONS(NSUInteger, PHAssetBurstSelectionType) {
@@ -176,4 +179,11 @@
 } API_AVAILABLE(ios(9));
 
 API_AVAILABLE_END
+
+typedef NS_ENUM(NSInteger, PHObjectType) {
+    PHObjectTypeAsset                = 1,
+    PHObjectTypeAssetCollection      = 2,
+    PHObjectTypeCollectionList       = 3,
+} API_AVAILABLE(macos(13), ios(16), tvos(16));
+
 #endif
Clone this wiki locally