Overview
- I have a custom type
Statisticsthat has 3 properties inside it - I am trying to return this as part of the AppIntent's
perforrmmethod
struct Statistics {
var countA: Int
var countB: Int
var countC: Int
}
I would like to implement the AppIntent to return Statistics as follows:
func perform() async throws -> some IntentResult & ReturnsValue<Statistics> {
...
...
}
Problem
- It doesn't make much sense to make Statistics as an
AppEntityas this is only computed as a result. - Statistics doesn't exist as a persisted entity in the app.
Questions
- How can I implement Statistics?
- Does it have to be AppEntity (I am trying to avoid this)? (
defaultQuerywould never be used.) - What is the correct way tackle this?