Repository navigation
PhotosUI MacCatalyst xcode27.3 b2
Alex Soto edited this page Nov 24, 2026
·
2 revisions
#PhotosUI.framework https://github.com/dotnet/macios/pull/27400
diff -ruN /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PHPhotosUIError.h /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PHPhotosUIError.h
--- /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PHPhotosUIError.h 1969-12-31 19:00:00
+++ /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PHPhotosUIError.h 2026-11-23 18:18:38
@@ -0,0 +1,44 @@
+//
+// PHPhotosUIError.h
+// PhotosUI
+//
+// Copyright © 2026 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+API_AVAILABLE_BEGIN(ios(27.3), macos(27.3), visionos(27.3))
+API_UNAVAILABLE_BEGIN(tvos, watchos)
+
+/**
+ * @abstract The error domain for errors produced by PhotosUI.
+ */
+OS_EXPORT NSErrorDomain const PHPhotosUIErrorDomain;
+
+/**
+ * @abstract Error codes delivered via `PHPhotosUIErrorDomain` describing why an
+ * operation failed.
+ *
+ * @discussion Every error in this domain carries a user-presentable `localizedDescription`.
+ */
+typedef NS_ERROR_ENUM(PHPhotosUIErrorDomain, PHPhotosUIError) {
+ /// No album could be resolved for the supplied local identifier in the specified photo library.
+ PHPhotosUIAssetCollectionNotFoundError NS_SWIFT_NAME(assetCollectionNotFound) = 1,
+
+ /// The user does not have permission to add content to the target album.
+ PHPhotosUIAssetCollectionNotWritableError NS_SWIFT_NAME(assetCollectionNotWritable) = 2,
+
+ /// Album creation did not produce an asset collection.
+ PHPhotosUIAssetCollectionCreationFailedError NS_SWIFT_NAME(assetCollectionCreationFailed) = 3,
+
+ /// The target shared album is in the process of migrating and can't accept new content until migration completes.
+ PHPhotosUISharedAlbumMigrationInProgressError NS_SWIFT_NAME(sharedAlbumMigrationInProgress) = 100,
+
+ /// The requested operation requires iCloud Photos, which is not enabled on this device.
+ PHPhotosUIICloudPhotosNotEnabledError NS_SWIFT_NAME(iCloudPhotosNotEnabled) = 101,
+};
+
+API_UNAVAILABLE_END // tvos, watchos
+API_AVAILABLE_END // ios(27.3), macos(27.3), visionos(27.3)
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PHPicker.h /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PHPicker.h
--- /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PHPicker.h 2026-11-04 03:32:11
+++ /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PHPicker.h 2026-11-23 18:18:38
@@ -62,8 +62,14 @@
PHPickerCapabilitiesCollectionNavigation = 1 << 2,
/// The "Cancel" and the "Add" (if possible) button.
PHPickerCapabilitiesSelectionActions = 1 << 3,
- /// Show intervention UI explaining potential risks for kids or teens if a sensitive asset is selected. Analysis and intervention will only be performed if "Communication Safety" is enabled in ScreenTime.
+ /// The intervention UI explaining potential risks for kids or teens if a sensitive asset is selected. Analysis and intervention will only be performed if "Communication Safety" is enabled in ScreenTime.
PHPickerCapabilitiesSensitivityAnalysisIntervention = 1 << 4,
+ /// Automatically updates the modal in presentation (interactive dismissal) state.
+ PHPickerCapabilitiesAutomaticModalInPresentation API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3)) = 1 << 5,
+ /// Automatically updates the preferred content size.
+ PHPickerCapabilitiesAutomaticPreferredContentSize API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3)) = 1 << 6,
+ /// The sidebar for navigation.
+ PHPickerCapabilitiesSidebar API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3)) = 1 << 7,
} API_AVAILABLE(ios(17), macos(14)) API_UNAVAILABLE(watchos, tvos);
/// Constants that specify metadata options for \c PHPickerViewController.
@@ -74,8 +80,58 @@
PHPickerMetadataOptionsRemoveLocation = 1 << 0,
/// Remove captions metadata.
PHPickerMetadataOptionsRemoveCaptions = 1 << 1,
+ /// Remove the metadata that marks the asset as an Apple Reference Image.
+ PHPickerMetadataOptionsRemoveAppleReferenceImage API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3)) = 1 << 2,
+ /// Remove keyword metadata.
+ PHPickerMetadataOptionsRemoveKeywords API_AVAILABLE(ios(27), macos(27), visionos(27)) = 1 << 3,
} API_AVAILABLE(ios(27), macos(27), visionos(27)) API_UNAVAILABLE(watchos, tvos);
+/// An enum that determines the minimum length for the thumbnail.
+typedef NS_ENUM(NSInteger, PHPickerResultThumbnailSize) {
+ /// Minimum length is about 100 pixels.
+ PHPickerResultThumbnailSizeSmall = 1,
+ /// Minimum length is about 360 pixels.
+ PHPickerResultThumbnailSizeStandard = 2,
+} NS_SWIFT_SENDABLE API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3)) API_UNAVAILABLE(watchos, tvos);
+
+/// An enum that determines the primary button type for the picker.
+typedef NS_ENUM(NSInteger, PHPickerPrimaryButtonType) {
+ /// The system chooses the primary button based on context.
+ PHPickerPrimaryButtonTypeAutomatic = 0,
+ /// No primary button is shown.
+ PHPickerPrimaryButtonTypeNone NS_SWIFT_NAME(hidden) = 1,
+ /// An "Add" button.
+ PHPickerPrimaryButtonTypeAdd = 2,
+ /// A "Done" button.
+ PHPickerPrimaryButtonTypeDone = 3,
+ /// An "Edit" button.
+ PHPickerPrimaryButtonTypeEdit = 4,
+ /// A "Save" button.
+ PHPickerPrimaryButtonTypeSave = 5,
+ /// A "Next" button.
+ PHPickerPrimaryButtonTypeNext = 6,
+ /// A "Choose" button.
+ PHPickerPrimaryButtonTypeChoose = 7,
+ /// A "Continue" button.
+ PHPickerPrimaryButtonTypeContinue = 8,
+} NS_SWIFT_SENDABLE API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3)) API_UNAVAILABLE(watchos, tvos);
+
+/// An enum that determines the secondary button type for the picker.
+typedef NS_ENUM(NSInteger, PHPickerSecondaryButtonType) {
+ /// The system chooses the secondary button based on context.
+ PHPickerSecondaryButtonTypeAutomatic = 0,
+ /// No secondary button is shown.
+ PHPickerSecondaryButtonTypeNone NS_SWIFT_NAME(hidden) = 1,
+ /// A "Cancel" button.
+ PHPickerSecondaryButtonTypeCancel = 2,
+ /// A "Back" button.
+ PHPickerSecondaryButtonTypeBack = 3,
+ /// A "Close" button.
+ PHPickerSecondaryButtonTypeClose = 4,
+ /// A "Clear" button that clears the current selection.
+ PHPickerSecondaryButtonTypeClear = 5,
+} NS_SWIFT_SENDABLE API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3)) API_UNAVAILABLE(watchos, tvos);
+
NS_ASSUME_NONNULL_END
API_AVAILABLE_BEGIN(ios(14), macos(13))
@@ -89,6 +145,9 @@
API_UNAVAILABLE(watchos)
@interface PHPickerSearchText : NSObject <NSCopying>
+/// Whether the search field should be focused when the picker opens, or when this search text is updated via \c PHPickerUpdateConfiguration. Default is \c NO.
+@property (nonatomic) BOOL prefersAutomaticFocus API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
/// Creates a search text from a string.
- (instancetype)initWithString:(NSString *)string API_AVAILABLE(ios(27), macos(27), visionos(27));
@@ -143,6 +202,9 @@
/// The filter for spatial media.
@property (nonatomic, class, readonly) PHPickerFilter *spatialMediaFilter API_AVAILABLE(ios(18), macos(15), visionos(2));
+/// The filter for media with a landscape aspect ratio.
+@property (nonatomic, class, readonly) PHPickerFilter *landscapeAspectRatioFilter API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
/// Returns a new filter based on the asset playback style.
+ (PHPickerFilter *)playbackStyleFilter:(PHAssetPlaybackStyle)playbackStyle API_AVAILABLE(ios(15));
@@ -159,6 +221,23 @@
@end
+/// An aspect ratio for the items that \c PHPickerViewController shows.
+OS_EXPORT
+NS_REFINED_FOR_SWIFT
+API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3))
+@interface PHPickerAspectRatio : NSObject <NSCopying>
+
+/// Aspect ratio based on the device.
+@property (nonatomic, class, readonly) PHPickerAspectRatio *deviceAspectRatio API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// Creates a custom aspect ratio (width / height).
+/// @param aspectRatio The ratio of an item's width to its height. Must be greater than 0.
+- (instancetype)initWithAspectRatio:(CGFloat)aspectRatio NS_DESIGNATED_INITIALIZER API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+- (instancetype)init NS_UNAVAILABLE;
+
+@end
+
/// An update configuration for \c PHPickerViewController.
OS_EXPORT
NS_REFINED_FOR_SWIFT
@@ -168,12 +247,32 @@
/// The maximum number of assets that can be selected.
@property (nonatomic) NSInteger selectionLimit API_AVAILABLE(ios(17), macos(14));
+/// The minimum number of items that should be selected. Default is \c NSNotFound.
+/// @discussion Setting \c minimumSelectionLimit to \c NSNotFound means 1 without preselection and 0 with preselection.
+@property (nonatomic) NSInteger minimumSelectionLimit API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
/// Edges of the picker that have no margin between the content and the edge (e.g. without bars in between).
@property (nonatomic) NSDirectionalRectEdge edgesWithoutContentMargins API_AVAILABLE(ios(17), macos(14));
/// The search text for the picker.
@property (nonatomic, copy, nullable) PHPickerSearchText *searchText API_AVAILABLE(ios(27), macos(27), visionos(27));
+/// The localized title to override the default title when the picker is presented. Default is \c nil.
+@property (nonatomic, copy, nullable) NSString *title API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// The localized string to be shown when the picker is presented. Default is \c nil.
+@property (nonatomic, copy, nullable) NSString *prompt API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// The primary button type. Default is \c PHPickerPrimaryButtonTypeAutomatic.
+@property (nonatomic) PHPickerPrimaryButtonType primaryButtonType API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// The secondary button type. Default is \c PHPickerSecondaryButtonTypeAutomatic.
+@property (nonatomic) PHPickerSecondaryButtonType secondaryButtonType API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// The collection of items to be shown. Default is \c nil.
+/// @discussion An identifier that doesn't resolve is treated as \c nil.
+@property (nonatomic, copy, nullable) NSString *containerIdentifier API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
@end
/// A configuration for \c PHPickerViewController.
@@ -193,6 +292,10 @@
/// @discussion Setting \c selectionLimit to 0 means maximum supported by the system.
@property (nonatomic) NSInteger selectionLimit API_UNAVAILABLE(watchos);
+/// The minimum number of items that should be selected. Default is \c NSNotFound.
+/// @discussion Setting \c minimumSelectionLimit to \c NSNotFound means 1 without preselection and 0 with preselection.
+@property (nonatomic) NSInteger minimumSelectionLimit API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
/// Types of assets that can be shown. Default is \c nil.
/// @discussion Setting \c filter to \c nil means all asset types can be shown.
@property (nonatomic, copy, nullable) PHPickerFilter *filter API_UNAVAILABLE(watchos);
@@ -216,6 +319,25 @@
/// The search text for the picker. Default is \c nil.
@property (nonatomic, copy, nullable) PHPickerSearchText *searchText API_AVAILABLE(ios(27), macos(27), visionos(27));
+/// The primary button type. Default is \c PHPickerPrimaryButtonTypeAutomatic.
+@property (nonatomic) PHPickerPrimaryButtonType primaryButtonType API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// The secondary button type. Default is \c PHPickerSecondaryButtonTypeAutomatic.
+@property (nonatomic) PHPickerSecondaryButtonType secondaryButtonType API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// The aspect ratio of items in the picker. Default is \c nil.
+@property (nonatomic, copy, nullable) PHPickerAspectRatio *aspectRatio API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// The collection of items that can be shown. Default is \c nil.
+/// @discussion Setting \c containerIdentifier to \c nil means items in any collection can be shown. An identifier that doesn't resolve is treated as \c nil.
+@property (nonatomic, copy, nullable) NSString *containerIdentifier API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// The localized title to override the default title when the picker is presented. Default is \c nil.
+@property (nonatomic, copy, nullable) NSString *title API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// The localized string to be shown when the picker is presented. Default is \c nil.
+@property (nonatomic, copy, nullable) NSString *prompt API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
/// Initializes a new configuration with the \c photoLibrary the picker should use.
- (instancetype)initWithPhotoLibrary:(PHPhotoLibrary *)photoLibrary API_UNAVAILABLE(watchos);
@@ -236,6 +358,11 @@
/// The local identifier of the selected asset.
@property (nonatomic, readonly, nullable) NSString *assetIdentifier API_UNAVAILABLE(watchos);
+/// Returns a thumbnail using the provided \c PHPickerResultThumbnailSize.
+/// @param preferredSize A size recommendation for the thumbnail.
+/// @param resultHandler Completion handler which returns the thumbnail URL and an error if there is one. The file at the URL is removed when the handler returns, so copy it to keep it.
+- (void)requestThumbnailImageURLForPreferredSize:(PHPickerResultThumbnailSize)preferredSize resultHandler:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))resultHandler API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
- (instancetype)init NS_UNAVAILABLE;
@end
@@ -252,6 +379,16 @@
/// Called when the user completes a selection or dismisses \c PHPickerViewController using the cancel button.
/// @discussion The picker won't be automatically dismissed when this method is called.
- (void)picker:(PHPickerViewController *)picker didFinishPicking:(NSArray<PHPickerResult *> *)results API_UNAVAILABLE(watchos);
+
+@optional
+
+/// Called when the user taps the primary button.
+/// @discussion The picker won't be automatically dismissed when this method is called.
+- (void)pickerDidPerformPrimaryAction:(PHPickerViewController *)picker API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
+
+/// Called when the user taps the secondary button.
+/// @discussion The picker won't be automatically dismissed when this method is called.
+- (void)pickerDidPerformSecondaryAction:(PHPickerViewController *)picker API_AVAILABLE(ios(27.3), macos(27.3), visionos(27.3));
@end
diff -ruN /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PhotosUI.h /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PhotosUI.h
--- /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PhotosUI.h 2026-11-04 03:32:11
+++ /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/iOSSupport/System/Library/Frameworks/PhotosUI.framework/Headers/PhotosUI.h 2026-11-23 18:18:38
@@ -21,6 +21,7 @@
#if TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_VISION
#import <PhotosUI/PHContentEditingController.h>
#import <PhotosUI/PHPhotoLibrary+PhotosUISupport.h>
+#import <PhotosUI/PHPhotosUIError.h>
#import <PhotosUI/PHSharedAlbumCreationViewController.h>
#import <PhotosUI/PHSharedAlbumCustomizationViewController.h>
#import <PhotosUI/PHSharedAlbumPostingViewController.h>