Skip to content

PhotosUI iOS xcode13.0 beta1

tj_devel709 edited this page Jun 21, 2021 · 3 revisions

#PhotosUI.framework https://github.com/xamarin/xamarin-macios/pull/11945

diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHLivePhotoView.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHLivePhotoView.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHLivePhotoView.h	2021-03-16 08:46:19.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHLivePhotoView.h	2021-06-02 12:45:54.000000000 -0400
@@ -56,6 +56,8 @@
 @protocol PHLivePhotoViewDelegate <NSObject>
 @optional
 
+- (BOOL)livePhotoView:(PHLivePhotoView *)livePhotoView canBeginPlaybackWithStyle:(PHLivePhotoViewPlaybackStyle)playbackStyle;
+
 - (void)livePhotoView:(PHLivePhotoView *)livePhotoView willBeginPlaybackWithStyle:(PHLivePhotoViewPlaybackStyle)playbackStyle;
 
 - (void)livePhotoView:(PHLivePhotoView *)livePhotoView didEndPlaybackWithStyle:(PHLivePhotoViewPlaybackStyle)playbackStyle;
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHPhotoLibrary+PhotosUISupport.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHPhotoLibrary+PhotosUISupport.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHPhotoLibrary+PhotosUISupport.h	2021-03-16 08:46:20.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHPhotoLibrary+PhotosUISupport.h	2021-06-02 12:45:54.000000000 -0400
@@ -24,6 +24,16 @@
  */
 - (void)presentLimitedLibraryPickerFromViewController:(UIViewController *)controller;
 
+/**
+ @abstract Prompt the user to update their limited library selection by presenting the limited library image picker when the user has opted into limited library access mode (see \c PHAuthorizationStatusLimited )
+ @param controller The view controller that is used to present the limited library picker.
+ @param completionHandler The block that will be called upon the user finishing their selection. Only newly selected assets will be provided to the block.
+ @discussion Use this API when the user has enabled limited photo library access to present the limited library picker and give the user a way to update their selection. If the user has not enabled limited library access mode for this application, then this method will do nothing. This should be used when disabling the automatic limited library alert prompt (by adding \c PHPhotoLibraryPreventAutomaticLimitedAccessAlert = \c YES to the application's Info.plist).
+ 
+ In addition to being provided the new asset local identifiers in the callback any changes applied to the limited library selection by the user will trigger a \c PHPhotoLibraryChangeObserver update that can be used to observe the changes to the selection.
+ */
+- (void)presentLimitedLibraryPickerFromViewController:(UIViewController *)controller completionHandler:(void(^)(NSArray<NSString *>*))completionHandler API_AVAILABLE(ios(15));
+
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHPicker.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHPicker.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHPicker.h	2021-03-16 09:55:49.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHPicker.h	2021-06-02 11:08:24.000000000 -0400
@@ -24,6 +24,15 @@
      PHPickerConfigurationAssetRepresentationModeCompatible = 2,
  };
 
+/// An enum that determines how the picker handles user selection.
+NS_REFINED_FOR_SWIFT
+typedef NS_ENUM(NSInteger, PHPickerConfigurationSelection) {
+    /// Uses the default selection behavior.
+    PHPickerConfigurationSelectionDefault = 0,
+    /// Uses the selection order made by the user. Selected assets are numbered.
+    PHPickerConfigurationSelectionOrdered = 1,
+} API_AVAILABLE(ios(15));
+
 /// A filter used to restrict the types \c PHPickerViewController can display.
 __attribute__((objc_subclassing_restricted))
 OS_EXPORT
@@ -57,6 +66,9 @@
 /// @discussion Setting \c preferredAssetRepresentationMode to \c PHPickerConfigurationAssetRepresentationModeAutomatic means the best representation determined by the system will be used.
 @property (NS_NONATOMIC_IOSONLY) PHPickerConfigurationAssetRepresentationMode preferredAssetRepresentationMode;
 
+/// Selection behavior of the picker. Default is \c PHPickerConfigurationSelectionDefault.
+@property (NS_NONATOMIC_IOSONLY) PHPickerConfigurationSelection selection API_AVAILABLE(ios(15));
+
 /// Maximum number of assets that can be selected. Default is 1.
 /// @discussion Setting \c selectionLimit to 0 means maximum supported by the system.
 @property (NS_NONATOMIC_IOSONLY) NSInteger selectionLimit;
@@ -65,10 +77,14 @@
 /// @discussion Setting \c filter to \c nil means all asset types can be displayed.
 @property (NS_NONATOMIC_IOSONLY, copy, nullable) PHPickerFilter *filter;
 
-/// Initializes new configuration with the \c photoLibrary the picker should use.
+/// Local identifiers of assets to be shown as selected when the picker is presented. Default is an empty array.
+/// @discussion \c preselectedAssetIdentifiers should be an empty array if \c selectionLimit is 1 or \c photoLibrary is not specified. Returned item providers for preselected assets are always empty.
+@property (NS_NONATOMIC_IOSONLY, copy) NSArray<NSString *> *preselectedAssetIdentifiers API_AVAILABLE(ios(15));
+
+/// Initializes a new configuration with the \c photoLibrary the picker should use.
 - (instancetype)initWithPhotoLibrary:(PHPhotoLibrary *)photoLibrary;
 
-/// Initializes new configuration with the system photo library. This configuration never returns asset identifiers.
+/// Initializes a new configuration with the system photo library. This configuration never returns asset identifiers.
 - (instancetype)init;
 
 @end
@@ -125,7 +141,7 @@
 /// The delegate to be notified.
 @property (NS_NONATOMIC_IOSONLY, weak) id<PHPickerViewControllerDelegate> delegate NS_REFINED_FOR_SWIFT;
 
-/// Initializes new picker with the \c configuration the picker should use.
+/// Initializes a new picker with the \c configuration the picker should use.
 - (instancetype)initWithConfiguration:(PHPickerConfiguration *)configuration NS_DESIGNATED_INITIALIZER NS_REFINED_FOR_SWIFT;
 
 + (instancetype)new NS_UNAVAILABLE;
Clone this wiki locally