Skip to content

PhotosUI tvOS xcode14.0 beta1

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

#PhotosUI.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/PhotosUI.framework/Headers/PHLivePhotoView.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHLivePhotoView.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHLivePhotoView.h	2022-02-23 07:08:50.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PHLivePhotoView.h	2022-06-03 18:06:09.000000000 -0400
@@ -7,18 +7,29 @@
 
 #import <TargetConditionals.h>
 
+#if TARGET_OS_IPHONE
 #import <Photos/Photos.h>
 #import <UIKit/UIKit.h>
+#elif TARGET_OS_OSX
+#import <AppKit/AppKit.h>
+#import <Photos/PHLivePhoto.h>
+#endif
 
 NS_ASSUME_NONNULL_BEGIN
+#if TARGET_OS_IPHONE
 API_AVAILABLE_BEGIN(ios(9.1), tvos(10))
+#elif TARGET_OS_OSX
+API_AVAILABLE_BEGIN(macos(10.12))
+#endif
 
 @protocol PHLivePhotoViewDelegate;
 
+#if TARGET_OS_IPHONE
 typedef NS_OPTIONS(NSUInteger, PHLivePhotoBadgeOptions) {
     PHLivePhotoBadgeOptionsOverContent  = 1 << 0,               ///< Include treatments so this image can be shown directly over the content of the Live Photo
     PHLivePhotoBadgeOptionsLiveOff      = 1 << 1,               ///< To indicate that the Live Photo aspect is turned off and it will be treated as a still (e.g. for sharing)
 };
+#endif
 
 typedef NS_ENUM(NSInteger, PHLivePhotoViewPlaybackStyle) {
     PHLivePhotoViewPlaybackStyleUndefined = 0,
@@ -26,29 +37,57 @@
     PHLivePhotoViewPlaybackStyleHint,
 };
 
+#if TARGET_OS_OSX
+typedef NS_ENUM(NSInteger, PHLivePhotoViewContentMode) {
+    PHLivePhotoViewContentModeAspectFit,
+    PHLivePhotoViewContentModeAspectFill,
+};
+#endif
 
 OS_EXPORT
+#if TARGET_OS_IPHONE
 @interface PHLivePhotoView : UIView
+#elif TARGET_OS_OSX
+@interface PHLivePhotoView : NSView
+#endif
 
+#if TARGET_OS_IPHONE
 /// System badge images representing Live Photo content
 + (UIImage *)livePhotoBadgeImageWithOptions:(PHLivePhotoBadgeOptions)badgeOptions;
+#endif
 
 @property (readwrite, nonatomic, weak, nullable) id<PHLivePhotoViewDelegate> delegate;
 
 /// Live photo displayed in the receiver.
 @property (readwrite, nonatomic, strong, nullable) PHLivePhoto *livePhoto;
 
+#if TARGET_OS_OSX
+/// The mode in which the receiver will display its content. Defaults to PHLivePhotoViewContentModeAspectFit.
+@property (readwrite, nonatomic, assign) PHLivePhotoViewContentMode contentMode;
+
+/// The audio volume during playback
+@property (readwrite, nonatomic, assign) float audioVolume;
+#endif
 
 /// Indicates whether the audio of the Live Photo is muted.
 @property (readwrite, nonatomic, assign, getter=isMuted) BOOL muted;
 
+#if TARGET_OS_IPHONE
 /// Gesture used to trigger playback. By default, added to the receiver. Can be moved to a different view.
 @property (readonly, nonatomic, strong) UIGestureRecognizer *playbackGestureRecognizer;
+#endif
 
 /// The following methods allow the client to manually trigger playback. If the live photo is changed during playback, it will be immediately interrupted.
 - (void)startPlaybackWithStyle:(PHLivePhotoViewPlaybackStyle)playbackStyle;
 - (void)stopPlayback;
 
+#if TARGET_OS_OSX
+/// Stops live photo playback. If animated is NO, the photo is immediately displayed.
+- (void)stopPlaybackAnimated:(BOOL)animated;
+
+/// Directly access the livePhotoBadge in cases where it should be added to a different place in the view hierachy and not the live photo view. This can be useful when the live photo view is added to a scroll view.
+@property (readonly, nonatomic, strong, nullable) NSView *livePhotoBadgeView;
+#endif
 @end
 
 
@@ -62,6 +101,10 @@
 
 - (void)livePhotoView:(PHLivePhotoView *)livePhotoView didEndPlaybackWithStyle:(PHLivePhotoViewPlaybackStyle)playbackStyle;
 
+#if TARGET_OS_IPHONE // {
+// This will be called before gestureRecognizer get touch info (point location), so we need to provide the touch to delegate to decide.
+- (NSTimeInterval)livePhotoView:(PHLivePhotoView *)livePhotoView extraMinimumTouchDurationForTouch:(UITouch *)touch withStyle:(PHLivePhotoViewPlaybackStyle)playbackStyle;
+#endif // }
 @end
 
 API_AVAILABLE_END
diff -ruN /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PhotosUI.h /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PhotosUI.h
--- /Applications/Xcode_13.3.0.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PhotosUI.h	2022-02-15 22:34:51.000000000 -0500
+++ /Applications/Xcode_14.0.0-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk/System/Library/Frameworks/PhotosUI.framework/Headers/PhotosUI.h	2022-05-25 23:01:51.000000000 -0400
@@ -10,9 +10,29 @@
 
 #import <TargetConditionals.h>
 
+#if TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_TV
 #import <PhotosUI/PHLivePhotoView.h>
+#endif
 
-
-
+#if TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_WATCH
+#import <PhotosUI/PHPicker.h>
+#endif
+
+#if TARGET_OS_IOS || TARGET_OS_OSX
+#import <PhotosUI/PHContentEditingController.h>
+#endif
+
+#if TARGET_OS_IOS
+#import <PhotosUI/PHPhotoLibrary+PhotosUISupport.h>
+#endif
+
+#if TARGET_OS_OSX
+#import <PhotosUI/PhotosUITypes.h>
+#import <PhotosUI/PHProjectExtensionContext.h>
+#import <PhotosUI/PHProjectExtensionController.h>
+#import <PhotosUI/PHProjectInfo.h>
+#import <PhotosUI/PHProjectTypeDescription.h>
+#import <PhotosUI/PHProjectTypeDescriptionDataSource.h>
+#endif
 
 #endif // PhotosUI_PhotosUI_h
Clone this wiki locally