Returns an on-device index with the specified name and data protection class.


init(name: String, protectionClass: FileProtectionType?)



A name that pertains to your custom organization.


The file protection class. Acceptable values are none, complete, completeUnlessOpen, or completeUntilFirstUserAuthentication.

Return Value

An index that can handle items within the specified protection class.


Use this method to specify a protection class for an index. You can specify a default protection class for index items in the entitlements for your app.

See Also

Getting an Index

class func `default`() -> Self

Returns the default on-device index.

init(name: String)

Returns an on-device index with the specified name.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software