entity(for:)
Gets the identified attachment view as an entity, if the view with that identifier exists.
Declaration
func entity(for id: some Hashable) -> ViewAttachmentEntity?Parameters
- id:
The value that you used to tag the view when you define it in the
attachmentsparameter of the Realityview initializer Init(make:update:attachments:).
Return Value
The resolved attachment entity, or nil if RealityView can’t find an attachment view with the given id.
Discussion
Attachment entities are not automatically added to your RealityView’s content. To display an attachment, add it to your RealityView’s content using a function like RealityViewContent/add(_:).