An object for registering user-specific vocabulary that Siri requests might include.


class INVocabulary : NSObject


The INVocabulary object lets you augment your app’s global vocabulary with terms that are both unique to your app and to the current user of your app. Registering custom terms provides Siri with hints it needs to apply those terms appropriately to the corresponding intent objects. You may register custom terms only for specific types of content, including users of your app, custom workout names, or custom tags applied to a photo.

Some tips for specifying custom vocabulary include:

  • Be selective about the terms that you register for users. Include words and phrases only when their use in your app by the current user might differ from everyday usage.

  • Order terms from most important to least important. If you register a large number of entries, Siri may ingest only the ones at the beginning of your list.

  • Don’t register contact names that you retrieved from the user’s Contacts database. Register contacts only if your app manages contact information separately from the system databases.

  • Don’t use this class to register terms that are common to all users of your app. Include vocabulary that’s common to all users of your app in your app’s global vocabulary file. For information about specifying your app’s global vocabulary file, see SiriKit Programming Guide.

  • Your Intents extension must support at least one intent that uses the registered terms. It’s a programmer error to register terms that aren’t supported by any of your extension’s intents.

Use the shared vocabulary object only in your iOS app. Don’t try to register vocabulary from your Intents extension or Intents UI extension.


Getting the Shared Vocabulary Object

class func shared() -> Self

Returns the shared vocabulary object.

Updating the User-Specific Vocabulary

func setVocabulary(NSOrderedSet, of: INVocabularyStringType)

Registers the specified vocabulary strings with the user.

enum INVocabularyStringType

Possible usages for a custom vocabulary term.

func setVocabularyStrings(NSOrderedSet, of: INVocabularyStringType)

Registers the specified vocabulary strings with the user.

func removeAllVocabularyStrings()

Removes all user-specific vocabulary strings.


Inherits From

Conforms To

See Also

Custom Vocabulary

Registering Custom Vocabulary with SiriKit

Register your app’s custom terminology, and provide sample phrases for how to use your app with Siri.