A File Provider extension's domain.


class NSFileProviderDomain : NSObject


You can use domains to partition a file provider's content. When you use domains, a single file provider can act as if multiple file providers were installed, and users can dynamically switch from one domain to another. You can use domains to represent different accounts or locations.

By default, a File Provider extension has no domain. You can register domains by calling the NSFileProviderManager class's add(_:completion:) method. A new NSFileProviderExtension instance is created for each domain that you register. The NSFileProviderExtension object's domain property indicates which domain the file provider belongs to. Any items returned by that file provider also belong to the domain.


Creating Domains

Accessing Data

var displayName: String

The name of the domain displayed in the user interface.

var identifier: NSFileProviderDomainIdentifier

The domain's unique identifier.

var pathRelativeToDocumentStorage: String

The path of the domain's subdirectory relative to the file provider's shared container.


Inherits From

Conforms To

See Also

Working with Domains

init?(for: NSFileProviderDomain)

Returns a newly created file provider manager for the specified domain.

class func remove(NSFileProviderDomain, completionHandler: (Error?) -> Void)

Removes a domain from the File Provider extension.

class func removeAllDomains(completionHandler: (Error?) -> Void)

Removes all domains from the File Provider extension.