"Drawing fully immersive content using Metal" swift is not all in Swift code

Hi there, I'm trying to test the "Drawing fully immersive content using Metal" , but when I select Language: Swift, it still shows Objective C code in some sample codes. Please check and update the document Swift Code, thank you.

Answered by DTS Engineer in 804212022

The intention of the article is to show how to integrate Compositor Services into an Objective-C based app.

This why all code snippets from Configure your app's rendering loop until Respond to interactions with your custom content are shown in Obj-C irrespective what you select from the Language: menu on the page.

Note that this Obj-C code is fictitious and purely for the sake of example. That said, Compositor Services certainly integrates with a Swift-based app. If you would like us to show how to integrate into a Swift-based app then please send us an enhancement request with the Feedback Assistant.

You can also check out Interacting with virtual content blended with passthrough which is the Swift-based sample project we published for WWDC24.

Accepted Answer

The intention of the article is to show how to integrate Compositor Services into an Objective-C based app.

This why all code snippets from Configure your app's rendering loop until Respond to interactions with your custom content are shown in Obj-C irrespective what you select from the Language: menu on the page.

Note that this Obj-C code is fictitious and purely for the sake of example. That said, Compositor Services certainly integrates with a Swift-based app. If you would like us to show how to integrate into a Swift-based app then please send us an enhancement request with the Feedback Assistant.

You can also check out Interacting with virtual content blended with passthrough which is the Swift-based sample project we published for WWDC24.

"Drawing fully immersive content using Metal" swift is not all in Swift code
 
 
Q