generatedContent
This instance represented as generated content.
Declaration
var generatedContent: GeneratedContent { get }Discussion
Conformance to this protocol is provided by the @Generable macro. A manual implementation may be used to map values onto properties using different names. Use the generated content property as shown below, to manually return a new GeneratedContent with the properties you specify.
struct Person: ConvertibleToGeneratedContent {
var name: String
var age: Int
var generatedContent: GeneratedContent {
GeneratedContent(properties: [
"firstName": name,
"ageInYears": age
])
}
}