Skip to content

FileProvider iOS xcode13.2 b1

Alex Soto edited this page Oct 28, 2021 · 2 revisions

#FileProvider.framework

diff -ruN /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h /Applications/Xcode_13.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h
--- /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h	2021-09-09 16:46:18.000000000 -0400
+++ /Applications/Xcode_13.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h	2021-10-22 20:30:19.000000000 -0400
@@ -166,19 +166,20 @@
 /**
  Identity of the backing store of the domain on the system.
 
- This property only applies for extension that implement NSFileProviderReplicatedExtension.
+ This property only applies for extensions that implement NSFileProviderReplicatedExtension.
 
  This provides an identifier that uniquely identifies the backing store used by the system for
  the domain. When this identifier has changed, the system has dropped its backing store and is
  building a new one.
 
- The system may decide to rebuild its backing store if it got corrupted. The provider can also
- cause the backing store to be rebuilt by calling
- `-[NSFileProviderManager reimportItemsBelowItemWithIdentifier:completionHandler:]`.
+ The system may decide to rebuild its backing store if it got corrupted. The backing store can also
+ be rebuilt as a response to the provider calling `-[NSFileProviderManager reimportItemsBelowItemWithIdentifier:completionHandler:]`.
+ It is guaranteed that calling reimport on the root item will cause the backing store to be rebuilt,
+ but the system can also decide to do so when reimport is called on other items.
 
  When rebuilding the backing store, the system will invalidate any extension instance associated
- to that domain. As a consequence, the identity of the backing store is guaranteed to be stable
- for the lifetime of the NSFileProviderReplicatedExtension instance.
+ to that domain. As a consequence, the identity of the backing store associated with that domain
+ is guaranteed to be stable for the lifetime of the NSFileProviderReplicatedExtension instance.
  */
 @property (nonatomic, readonly, nullable) NSData *backingStoreIdentity FILEPROVIDER_API_AVAILABILITY_V4_0;
 
diff -ruN /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderEnumerating.h /Applications/Xcode_13.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderEnumerating.h
--- /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderEnumerating.h	2021-08-17 02:23:51.000000000 -0400
+++ /Applications/Xcode_13.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderEnumerating.h	2021-10-20 04:14:55.000000000 -0400
@@ -84,10 +84,9 @@
 - (void)didDeleteItemsWithIdentifiers:(NSArray <NSFileProviderItemIdentifier> *)deletedItemIdentifiers;
 
 /**
- Call the following method every so often while sending changes, particularly
- while enumerating changes to NSFileProviderWorkingSetContainerItemIdentifier.
- If the device reboots during an enumeration, it would later resume starting
- at the latest known sync anchor.
+ This method is used to complete a batch of changes. Follow the advice
+ in -[NSFileProviderChangeObserver suggestedBatchSize] to determine when to
+ call this method.
 
  It is expected that the sync anchor passed here be different than the sync
  anchor that the enumeration started at, unless the client was already up to
@@ -123,8 +122,12 @@
  it split the list of changes into several batches. If the enumerator does not have suggestedBatchSize ready to
  enumerator, the enumerator should finish immediately and not wait for more incoming changes to enumerate.
 
- By taking into account the suggested size, the enumeration will guarantee the best user experience possible. The
- system enforces a maximum of 100 times the suggested size.
+ By taking into account the suggested size, the enumeration will guarantee the best user experience possible. Large
+ batches can cause performance issues. And when the device reboots, enumerations will resume from the latest
+ known sync anchor. Telling the system about the latest sync anchor more frequently will reduce the number
+ of re-enumerations on system reboot.
+
+ The system enforces a maximum of 100 times the suggested size.
  */
 @property (nonatomic, readonly) NSInteger suggestedBatchSize FILEPROVIDER_API_AVAILABILITY_V3;
 
diff -ruN /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h /Applications/Xcode_13.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h
--- /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h	2021-09-09 16:49:25.000000000 -0400
+++ /Applications/Xcode_13.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderItem.h	2021-10-22 20:14:08.000000000 -0400
@@ -64,6 +64,21 @@
 @interface NSFileProviderItemVersion : NSObject
 
 /**
+ Version component exposed by the system to denote a state that predates a version returned by the provider.
+
+ In case an item was created by calling `createItemBasedOnTemplate` and the item returned by the provider in
+ the completion handler of that call didn't match the item template passed by the system, the system will try
+ to apply the changes asked by the provider to the disk. However, the system may detect conflicts when applying
+ those content back to the disk, which will cause the system to send the new disk version to the extension,
+ by calling `modifyItem` or `deleteItemWithIdentifier` with a `baseVersion` that represents the item as passed in
+ the template of the `createItemBasedOnTemplate` call.
+
+ This constant is used by the system to represent that specific version that was communicated by the system to
+ the extension but does not have a corresponding version assigned by the extension.
+ */
+@property (class, readonly, nonnull) NSData *beforeFirstSyncComponent FILEPROVIDER_API_AVAILABILITY_V4_0;
+
+/**
  Items versions have two distinct components, one for the file contents and one
  for metadata.
 
@@ -566,6 +581,7 @@
                              This will ensure that the system does not display it's warnings when the user is deleting a file.
                  'ExcludeFromSync' : deleting items(s) because the user chose to exclude those from sync (available in macOS 12.0 and later)
                  'Rename'  : renaming item(s) (available in macOS 11.3 and later)
+                             The destinationItem has only the `filename` field populated (available in macOS 12.0.1 and later).
             - `sourceItem` : current item that the predicate is evaluating. Present for Move/MoveOut/Copy/CopyOut/Create/Trash/Delete/ExcludeFromSync/Rename
             - `sourceItemsCount` :
                 - In userInteraction, represents the count of sourceItems of an action operation
@@ -607,11 +623,16 @@
  matches, then both of the UserInteraction alerts will be shown to the user. However, as soon as the user
  denies any of the alerts, the remainder will not be shown, and the action will be denied.
 
+ If the provider wishes to take full responsibility for showing a custom contextual menu item for Download,
+ 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.
+
  Here is a sample extension Info.plist:
 

NSExtension

  • ...
  • NSExtensionFileProviderAllowsContextualMenuDownloadEntry
  • NSFileProviderUserInteractions ActivationRule

diff -ruN /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h /Applications/Xcode_13.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h --- /Applications/Xcode_13.1.0-rc.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h 2021-09-09 16:46:18.000000000 -0400 +++ /Applications/Xcode_13.2.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h 2021-10-22 20:14:08.000000000 -0400 @@ -176,8 +176,7 @@ Any other error, including crashes of the extension process, will be considered to be transient and will cause the enumeration to be retried.

  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain,
  • or NSPOSIXErrorDomain.
  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain.

    For errors which can not be represented using an existing error code in one of these domains, the extension should construct an NSError with domain NSCocoaErrorDomain and code NSXPCConnectionReplyInvalid. @@ -267,8 +266,7 @@ Any other error, including crashes of the extension process, will be considered to be transient and will cause the lookup to be retried.

  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain,
  • or NSPOSIXErrorDomain.
  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain.

    For errors which can not be represented using an existing error code in one of these domains, the extension should construct an NSError with domain NSCocoaErrorDomain and code NSXPCConnectionReplyInvalid. @@ -358,8 +356,7 @@ Any other error, including crashes of the extension process, will be considered to be transient and will cause the download to be retried.

  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain,
  • or NSPOSIXErrorDomain.
  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain.

    For errors which can not be represented using an existing error code in one of these domains, the extension should construct an NSError with domain NSCocoaErrorDomain and code NSXPCConnectionReplyInvalid. @@ -509,8 +506,7 @@ Any other error, including crashes of the extension process, will be considered to be transient and will cause the creation to be retried.

  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain,
  • or NSPOSIXErrorDomain.
  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain.

    For errors which can not be represented using an existing error code in one of these domains, the extension should construct an NSError with domain NSCocoaErrorDomain and code NSXPCConnectionReplyInvalid. @@ -601,6 +597,10 @@ contentVersion in the completion handler's item. The system will subsequently call fetchContents to retrieve the new contents and replace them on disk.

  • The baseVersion might contain one or both component set to

  • NSFileProviderItemVersionComponentZero in case there has never been a version for

  • which the item on disk and the item in the provider were known to be in sync.

  • Structural consistency and Cycle handling:

    In case the parentItemIdentifier is modified, the system guarantees that the new @@ -670,8 +670,7 @@ Any other error, including crashes of the extension process, will be considered to be transient and will cause the modification to be retried.

  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain,
  • or NSPOSIXErrorDomain.
  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain.

    For errors which can not be represented using an existing error code in one of these domains, the extension should construct an NSError with domain NSCocoaErrorDomain and code NSXPCConnectionReplyInvalid. @@ -757,8 +756,7 @@ Any other error, including crashes of the extension process, will be considered to be transient and will cause the deletion to be retried.

  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain,
  • or NSPOSIXErrorDomain.
  • Errors must be in one of the following domains: NSCocoaErrorDomain, NSFileProviderErrorDomain.

    For errors which can not be represented using an existing error code in one of these domains, the extension should construct an NSError with domain NSCocoaErrorDomain and code NSXPCConnectionReplyInvalid.

Clone this wiki locally