Development note · Custom Component

Custom components support only 'simpler data' types — scalars, strings, SIMD values, and enums — with Xcode build-time errors for unsupported types.

by elkraneo · 2026-04-17

Apple's WWDC 2023 session 'Work with Reality Composer Pro content in Xcode' explicitly defines custom component type constraints. The session demonstrates PointOfInterestComponent with String, custom enum, and Optional<String> fields, and warns that Xcode produces errors for types RCP cannot serialize.

Metadata

  • Component: Custom Component
  • Status: confirmed
  • Confidence: high
  • Evidence type: inference
  • Scope: USDA authored
  • Author: elkraneo
  • Date: 2026-04-17
  • RCP version: 26.4
  • Xcode build: Xcode 26.4 (17C529)

Reproduction

  1. Watch WWDC 2023 session 'Work with Reality Composer Pro content in Xcode' (wwdc2023-10273).
  2. Navigate to ~22:31 where the speaker discusses custom component type constraints.
  3. Observe the PointOfInterestComponent example showing String, enum, and Optional<String> fields.
  4. Note the explicit warning: 'You'll see an error in your Xcode project if you add a property to your custom component that's of a type that Reality Composer Pro won't serialize.'
  5. Cross-reference demonstrated types with the USD-serializable subset (bool, int, uint, float, double, string, token, float2/3/4, quatf).

Evidence

Details

Source

WWDC 2023 session “Work with Reality Composer Pro content in Xcode” (wwdc2023-10273).

At 22:31:

“Design-time components are for housing simpler data, such as ints, strings, and SIMD values, things that 3D artists and designers will make use of.”

And:

“You’ll see an error in your Xcode project if you add a property to your custom component that’s of a type that Reality Composer Pro won’t serialize.”

Example from the Session

The session demonstrates a PointOfInterestComponent example:

public struct PointOfInterestComponent: Component, Codable {
    public var region: Region = .yosemite  // Custom enum (serializes as string/token)
    public var name: String = "Ribbon Beach"
    public var description: String?        // Optional String
}

Supported Type Categories

CategorySwift TypesUSD TypeStatus
ScalarsBool, Int, UInt, Float, Double, Stringbool, int, uint, float, double, string✓ Supported
OptionalsString?, scalar optionalsSame as base type✓ Supported
SIMDSIMD2<Float>, SIMD3<Float>, SIMD4<Float>, simd_quatffloat2, float3, float4, quatf✓ Supported
EnumsCustom string-based enumstoken✓ Supported
Arrays[Bool], [Int], [Float], etc.bool[], int[], float[]✗ Not supported

What to Avoid

The session’s “simpler data” constraint explicitly excludes:

Unsupported TypeExampleWhy It Fails
Entity referencesEntity?Use rel relationships instead
Complex nested structsNested CodableOnly simple enums serialize
Runtime-only typesObjectIdentifierNot USD-serializable
Half-precision SIMDSIMD3<Float16>No half3 support in RCP
Integer vectorsSIMD3<Int32>No int3 support in RCP

Build-Time Validation

Unlike runtime errors, RCP provides compile-time feedback through Xcode:

RCP generates Swift code from the USD schema
        ↓
Xcode attempts to compile the generated code
        ↓
Build fails with clear error for unsupported types

This makes custom components self-documenting — the supported types are exactly those that survive the codegen → compile pipeline.

Inspector-Safe Type Palette

For custom component field editing in Deconstructed, use these verified types:

#CategorySwift Types
1ScalarsBool, Int, UInt, Float, Double, String
2OptionalsBool?, Int?, Float?, String?
3SIMDSIMD2<Float>, SIMD3<Float>, SIMD4<Float>, simd_quatf
4EnumsString or Int raw-value enums
5Arrays⚠️ Currently unsupported in RCP
Pageview analytics comparison

We are comparing self-hosted OpenPanel with the analytics already used on this site. This comparison records page paths, referring website origins, pageview times, random event IDs, browser and device information, and approximate location. Our server processes IP and browser information to generate rotating, pseudonymous visitor IDs. No tracking cookies or persistent visitor IDs are saved in your browser. Queries, fragments and page titles are removed; click tracking and session replay are off.

Do Not Track and Global Privacy Control disable OpenPanel. If you change the choice below, only that preference is saved in your browser. Existing analytics remain active during the comparison.