Formalizing our content using app entities
In our app intents, when we created a task, we returned a string value of the task’s title. However, a task is more than just a title – it contains a description, status, ID, and many more properties. In other words, a task is not a string or a Universally Unique Identifier (UUID) value type – it’s a structure named Task
.
The problem with App Intents is that no other app or the system knows what a Task
structure is since it’s our app’s internal type. We need to expose the type to the system intent world to make Task
a known type by the system.
Let’s connect that to a use case: creating and opening a task in the app. To make it modular, we want to create two intents: creating a task and opening a task. When we have the two intents, we can chain them in a shortcut.
Let’s start by letting the system know what Task
is.
Conforming to AppEntity
Conforming to the AppEntity
protocol...