My code was working in beta 7 but since I updated I'm getting the following error when trying to init a RealityView
'init(make:update:attachments:)' is unavailable in visionOS
I'm using:
RealityView { content, attachments in
// Code ...
} update: { content, attachments in
// Code ...
} attachments: {
// Code ...
}
As far as I can tell this big change went undocumented but the way attachments work completely changed:
Old:
RealityView { content, attachments in
content.add(Entity())
} attachments: {
Text("Hello")
.tag("h1")
}
New:
RealityView { content, attachments in
content.add(Entity())
} attachments: {
Attachment(id: "h1") {
Text("Hello")
}
}
Definitely an improvement but I hope it get’s added to the change log soon! Or at least get’s a helpful warning in the next Xcode! (edited)