How to use RealityKit Package Content in SceneKit

Oscar de la Hera Gomez
Three flowers that represent Swift, RealityKit and XCode side by side. Beneath them sits the text "Reality Kit Content in SceneKit."

Explicitly declare the resources in the Package.swift file, import the module and use the code found below.

The following tutorial reveals code our upcoming app Object Capture Pro. If you wish to be updated on the progress and release of this app, please subscribe using the link below.

This tutorial assumes that you have successfully added a Reality Kit Content to an XCode project. 

If you have not follow the tutorial below.

Step One: Update the Package

A screenshot of XCode showing the updates that we made to the package.swift file.

Update the Package.swift file within the  Reality Kit Content package to explicitly allow the resources to be available.

This is done by adding a line similar to the one below for each of the files to the resources array found within the .target of the targets.

.process("PACKAGE_NAME.rkassets/FILE_NAME.FILE_EXTENSION")

If you are having issues with this step, please consult the tutorial below to learn how to debug the contents of a package.

For more information, consult the Apple Developer documentation linked below.

Step Two: Add to SceneKit

A screenshot of XCode showing the code for converting RealityKit Content to a SCNScene.

Using code similar to the one below, use your RealityKit Content within a SCNScene.

Step Three: Test

A screenshot of the file within a sample NSView of Object Capture Pro.

Run the code and confirm everything works.

Looking to learn more about SwiftUI, Swift, Swift Testing, Design and Technology?

Search our blog to learn more about Swift, SwiftUI, Swift Testing, design and technology.

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details