One Logo Pool Ball
FoundationModels · IOS API REFERENCE

ImageReference.PartiallyGenerated

struct · iOS 27.0+ · SDK 27.1

nonisolated struct PartiallyGenerated

A representation of partially generated content

Members (3)

get · iOS 27.0+

id

Swift declaration
var id: GenerationID

The stable identity of the entity associated with this instance.

set · iOS 27.0+

id

Swift declaration
var id: GenerationID

The stable identity of the entity associated with this instance.

init · iOS 27.0+

init

Swift declaration
nonisolated init(_ content: GeneratedContent) throws

Creates an instance from content generated by a model. Conformance to this protocol is provided by the `@Generable` macro. You can provide a manual implementation to map values onto properties using different names. To manually initialize your type from generated content, decode the values as shown below: ```swift struct Person: ConvertibleFromGeneratedContent { var name: String var age: Int init(_ content: GeneratedContent) { self.name = try content.value(forProperty: "firstName") self.age = try content.value(forProperty: "ageInYears") } } ``` - Important: If your type also conforms to ``ConvertibleToGeneratedContent``, it is critical that this implementation be symmetrical with ``ConvertibleToGeneratedContent/generatedContent``. - SeeAlso: `@Generable` macro ``Generable(description:)``

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

ImageReference.PartiallyGenerated.attachmentLabel

This declaration needs Swift generic type arguments. (no canonical witness for Self)

All FoundationModels types →