Contents

getIdentifierForUserVisibleFile(at:completionHandler:)

Returns the identifier and domain for a user-visible URL.

Declaration

class func getIdentifierForUserVisibleFile(at url: URL, completionHandler: @escaping  @Sendable (NSFileProviderItemIdentifier?, NSFileProviderDomainIdentifier?, (any Error)?) -> Void)
class func identifierForUserVisibleFile(at url: URL) async throws -> (NSFileProviderItemIdentifier, NSFileProviderDomainIdentifier)

Parameters

  • url:

    The URL of the item.

  • completionHandler:

    A block that the system calls after it gets the items identifier. It has the following parameters:

    itemIdentifier

    The item’s identifier.

    domainIdentifier

    The identifier for the item’s domain.

    error

    If an error occurs, this object contains information about the error; otherwise, it’s nil.

Discussion

If the URL doesn’t refer to an item managed by your File Provider extension, the system returns a NSFileNoSuchFileError error.

See Also

Translating user-visible URLs