Sample CodemacOSReviewed 2026-07-21View on Apple Developer

Authoring Apple Immersive Video

At a glance

Item Summary
Purpose Prepare and package immersive video content for delivery.
App architecture A Swift sample centered on CreateAIVU, with direct use of AVFoundation, ImmersiveMediaSupport, ArgumentParser.
Main patterns No named application pattern supported by the extracted structure
Project style 2 scanned source file(s) across Swift, organized around ranked entry, type, and file boundaries.

Project structure

Source bundle/
├── ImmersiveMediaSupport Authoring/
│   ├── CreateAIVU.swift
│   └── CreateAIVUWriter.swift
├── Configuration/
│   └── SampleCode.xcconfig
└── ImmersiveMediaSupport Authoring.xcodeproj/
    ├── .xcodesamplecode.plist
    └── project.pbxproj

Structure observations

  • Architecturally prominent files are ranked from entry points and role-named declarations; resource-only paths are omitted.
  • Primary languages: Swift.
  • The verified tree contains 3 project/configuration file(s) and 3 source declaration(s).

Overall architecture

Reference code

ImmersiveMediaSupport Authoring/CreateAIVU.swift:14 — architecture anchor

@main
struct CreateAIVU: AsyncParsableCommand {
    // ...
}

Interpretation

The arrows summarize the source-visible entry, role-named types or folders, and framework direction; when nodes come from structural folders, the sequence is a high-level interpretation rather than proof that every adjacent node calls the next. Ownership is claimed only where the next section cites a stored property or assignment. The diagram is intentionally limited to the dominant path into Immersive Media Support.

Ownership and state

Ownership evidence

ImmersiveMediaSupport Authoring/CreateAIVU.swift:17 — stored dependency or nearest verified ownership anchor

    var inputFile: String
    
    @Option(name: [.short, .customLong("aime")], help: "AIME file with the correct camera calibrations for the provided input file.")
    var aimeFile: String?
    
    @Option(name: [.short, .customLong("usdz")],
            help: "Optional USDZ file for camera calibration to use instead of an AIME file. (Must be used with --mask option).")
Owner Object or state Relationship Mutation authority
CreateAIVU String (inputFile) owns value state App/module collaborators
CreateAIVU String (aimeFile) owns value state App/module collaborators
CreateAIVU String (usdzFile) owns value state App/module collaborators
CreateAIVU String (maskFile) owns value state App/module collaborators

Composition arrows indicate a source-visible construction expression or locally owned value state; aggregation means the owner stores or receives a dependency without proving exclusive lifetime ownership.

Class and protocol design

ImmersiveMediaSupport Authoring/CreateAIVU.swift:15 — representative type boundary

struct CreateAIVU: AsyncParsableCommand {
    // ...
}
Type Responsibility Depends on or conforms to
CreateAIVU Represents a feature value or composable behavior AsyncParsableCommand
RuntimeError Represents feature failure conditions Error, CustomStringConvertible
CreateAIVUWriter Owns feature behavior and collaborator lifecycle Concrete collaborators/imported frameworks

No local protocol conformance is claimed as protocol-oriented design; external framework conformances are listed only as dependencies.

Access control

Symbol Access Verified effect Likely rationale
customCreatedCalibrationId (ImmersiveMediaSupport Authoring/CreateAIVU.swift:33) private Use is restricted to the lexical declaration and same-file extensions allowed by Swift. Inference: keep state mutation or dependency lifetime inside the owning implementation.
createVenueDescriptor (ImmersiveMediaSupport Authoring/CreateAIVU.swift:70) private Use is restricted to the lexical declaration and same-file extensions allowed by Swift. Inference: hide an implementation step that is not part of the collaboration surface.
createPresentationDescriptor (ImmersiveMediaSupport Authoring/CreateAIVU.swift:104) private Use is restricted to the lexical declaration and same-file extensions allowed by Swift. Inference: hide an implementation step that is not part of the collaboration surface.
getMetadataItem (ImmersiveMediaSupport Authoring/CreateAIVUWriter.swift:102) private Use is restricted to the lexical declaration and same-file extensions allowed by Swift. Inference: hide an implementation step that is not part of the collaboration surface.

Reference code

ImmersiveMediaSupport Authoring/CreateAIVU.swift:33 — representative boundary

@main
struct CreateAIVU: AsyncParsableCommand {
    // ...
}

Swift declarations without a modifier are internal; explicit private, fileprivate, private(set), public, or open entries above are interpreted by language semantics. Objective-C/C samples instead rely on header and implementation boundaries, which are not equivalent to Swift lexical privacy.

Logic ownership and placement

Logic Owning type or file Placement rationale
Feature and framework orchestration CreateAIVU The sample keeps the demonstrated path in its primary concrete type.

Design patterns

Pattern Source evidence Purpose or tradeoff
No named application pattern ImmersiveMediaSupport Authoring/CreateAIVU.swift:14 The verified source directly composes concrete framework types; this document avoids forcing a pattern name.

Naming conventions

  • Types: feature-specific names rather than reusable layer suffixes.
  • Protocols: no local protocol declaration in the scanned source.
  • Methods: run, createVenueDescriptor, createPresentationDescriptor, create, getMetadataItem, getTimedMetadataGroup, getOutputProvider, getMetadataFormatDescription.
  • Files: ImmersiveMediaSupport Authoring/CreateAIVU.swift, ImmersiveMediaSupport Authoring/CreateAIVUWriter.swift.

Architecture takeaways

  • CreateAIVU is the main source-visible entry or composition anchor for this sample.
  • Framework work reaches AVFoundation, ImmersiveMediaSupport, ArgumentParser through a deliberately small high-level chain; the detailed API graph remains inside the cited implementation files.
  • Stored-property evidence identifies lifecycle collaboration; it does not by itself prove exclusive object ownership.
  • Access-control conclusions separate verified language visibility from the likely design rationale.
  • The source does not justify labeling the design protocol-oriented.

Source map

Source file Relevant symbols
ImmersiveMediaSupport Authoring/CreateAIVU.swift CreateAIVU, RuntimeError
ImmersiveMediaSupport Authoring/CreateAIVUWriter.swift CreateAIVUWriter