'init(make:update:attachments:)' is unavailable in visionOS

'init(make:update:attachments:)' is unavailable in visionOS

in Xcode 15 beta 8, but it's fine in beta 7

Answered by gie3d in 763882022

It's a change which is not in the document yet. From your code, I think you can fix it by

RealityView { content, _ in
    // ... your code
} update : { _, attachments in 
    // ... your code
} attachments: {
    Attachment(id: id) {
        // your code
    }
}

Adding the Attachment(id: id) { }

Accepted Answer

It's a change which is not in the document yet. From your code, I think you can fix it by

RealityView { content, _ in
    // ... your code
} update : { _, attachments in 
    // ... your code
} attachments: {
    Attachment(id: id) {
        // your code
    }
}

Adding the Attachment(id: id) { }

The attachments API changed a little bit for beta 8, it looks like this now:

attachments: {
            Attachment(id: "menuHead") {
                ...// your view here
            }
}
'init(make:update:attachments:)' is unavailable in visionOS
 
 
Q