arrayCount
TypeScriptget arrayCount(): (number) | nullSwift declarationvar arrayCount: Int? { get }The number of elements if this value holds an array. Returns `nil` otherwise.
struct · iOS 27.0+ · SDK 27.1
struct USDValueA type-erased container for a value stored in a Universal Scene Description file. `USDValue` wraps the various concrete value types USD recognises (numerics, strings, vectors, tokens, paths, asset paths, time codes, and so on) so they can be passed through generic APIs without exposing the underlying C++ representation.
get arrayCount(): (number) | nullSwift declarationvar arrayCount: Int? { get }The number of elements if this value holds an array. Returns `nil` otherwise.
unsafeValue(type?: "Bool" | "Int" | "UInt" | "Double" | "Float" | "String"): unknownSwift declarationfunc unsafeValue<T>(assumingType type: T.Type = T.self) -> T where T : USDValueProtocolReturns the wrapped value as `T` without checking the dynamic type. - Important: The behaviour is undefined when `T` does not match the stored type. Prefer ``value(as:)`` unless you have already confirmed the type with ``isHolding(_:)``.
value(type?: "Bool" | "Int" | "UInt" | "Double" | "Float" | "String"): (unknown) | nullSwift declarationfunc value<T>(as type: T.Type = T.self) -> T? where T : USDValueProtocolReturns the wrapped value if it is of type `T`, otherwise `nil`.
get isArray(): booleanSwift declarationvar isArray: Bool { get }Whether the wrapped value is an array.
get isEmpty(): booleanSwift declarationvar isEmpty: Bool { get }Whether this value is empty.
get typeName(): stringSwift declarationvar typeName: String { get }The name of the wrapped type.
isHolding(type: "Bool" | "Int" | "UInt" | "Double" | "Float" | "String"): booleanSwift declarationfunc isHolding<T>(_ type: T.Type) -> Bool where T : USDValueProtocolReturns whether this value holds a value of type `T`.
static init(): USDValueSwift declarationinit()Creates an empty value.
static init9821(value: number): USDValueSwift declarationinit<T>(_ value: T) where T : USDValueProtocolCreates a value wrapping `value`. - Parameter value: A value of any type that conforms to ``USDValueProtocol``.
No declarations were skipped in this snapshot.