Skip to content

FileProvider iOS xcode14.0 beta4

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

#FileProvider.framework https://github.com/xamarin/xamarin-macios/pull/15777

diff -ruN /Applications/Xcode_14.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h
--- /Applications/Xcode_14.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h	2022-06-30 22:08:17.000000000 -0400
+++ /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h	2022-07-22 10:06:04.000000000 -0400
@@ -219,8 +219,11 @@
  This property only applies for extensions that implement NSFileProviderReplicatedExtension.
 
  Defaults to YES. Set this to NO to indicate that the domain cannot sync the trash.
- In the case that the domain cannot sync the trash, the system might still offer trashing to the local trash when appropriate,
- but the operation will look like a delete to the extension.
+ If this property is set to YES the system will move the trashed item to the domain trash.
+ If this property is set to NO and the trashed item does not have the NSFileProviderItemCapabilitiesAllowsTrashing capability, the system will offer to permanently delete the item.
+ If this property is set to NO and the trashed item does have the NSFileProviderItemCapabilitiesAllowsTrashing capability, then the system will behave differently based on whether the item
+ is recursively materialized. If the item is fully materialized, it will be moved to the user's home trash and the operation will look like a delete to the extension.
+ If the item is not fully materialized, the system will offer to permanently delete the item.
  */
 @property (readwrite, assign) BOOL supportsSyncingTrash FILEPROVIDER_API_AVAILABILITY_V5_0;
 
diff -ruN /Applications/Xcode_14.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h
--- /Applications/Xcode_14.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h	2022-06-30 22:08:17.000000000 -0400
+++ /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h	2022-07-25 15:33:57.000000000 -0400
@@ -681,6 +681,39 @@
  the provider can set NSExtensionFileProviderAllowsContextualMenuDownloadEntry=0 in the provider's Info.plist.
  This will ensure that the system does not display the "Download Now" button in the contextual menu.
 
+ When `sourceItem` or `destinationItem` are present in a UserInteraction, a subset of the fields present on the item will be available for use.
+ The subset includes:
+ - `userInfo`
+ - `itemIdentifier`
+ - `parentItemIdentifier`
+ - `contentType`
+ - `typeIdentifier`
+ - `isTrashed`
+ - `filename`
+ - `capabilities`
+ - `documentSize`
+ - `childItemCount`
+ - `creationDate`
+ - `contentModificationDate`
+ - `lastUsedDate`
+ - `tagData`
+ - `favoriteRank`
+ - `isUploaded`
+ - `isUploading`
+ - `uploadingError`
+ - `isDownloaded`
+ - `isDownloading`
+ - `downloadingError`
+ - `isMostRecentVersionDownloaded`
+ - `isShared`
+ - `isSharedByCurrentUser`
+ - `ownerNameComponents`
+ - `mostRecentEditorNameComponents`
+ - `versionIdentifier`
+ - `inheritedUserInfo`
+ - `resolvedUserInfo`
+ - `isRecursivelyDownloaded`
+
  Here is a sample extension Info.plist:
 

diff -ruN /Applications/Xcode_14.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h --- /Applications/Xcode_14.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h 2022-06-30 22:10:42.000000000 -0400 +++ /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h 2022-07-22 10:06:04.000000000 -0400 @@ -342,6 +342,13 @@ */ @property (nonatomic, readonly) NSTimeInterval refreshInterval;

+/**

  • This property is set to YES when the enumeration of the pending set was capped at or below its maximum size.
  • Under normal conditions, the count of items pending sync will get lower as sync progresses, and this variable
  • will eventually be set to NO when the pending set again includes all items pending sync.
  • */ +@property (nonatomic, readonly, getter=isMaximumSizeReached) BOOL maximumSizeReached FILEPROVIDER_API_AVAILABILITY_V5_0_IOS;

@end

@interface NSFileProviderManager (PendingSet) diff -ruN /Applications/Xcode_14.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h --- /Applications/Xcode_14.0.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h 2022-06-30 22:08:17.000000000 -0400 +++ /Applications/Xcode_14.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h 2022-07-22 10:06:04.000000000 -0400 @@ -949,6 +949,12 @@ These constraints imply that initial transfer of a file from the disk to the provider will not be listed in the pending set, even though the transfer could take several minutes to complete

  • Furthermore, the pending set can only contain a limited number of items.
  • The pending set provides an easy way to design an "in progress" UI containing a few items
  • and to detect whether there's any activity pending on the system.
  • In case the pending set reached its maximum size items, newly pending items won't be included
  • in it. Already present items in the pending set will remain until they no longer are pending.
  • The pending set is refreshed regurlary but only if there are meaningful changes: new pending items, items that were pending but are not anymore (deletions from the set), or domain version changed and set is not empty
Clone this wiki locally