RVA

0.1.0

airovo/rva-swift

What's New

0.1.0

2026-10-08T19:52:01Z

Swift package pinning RVAFFI.xcframework from airovo/rva v0.1.2.

RVA for Swift

License

The Apple adapter for RVA (Responsive Visual Asset). It links the shared Rust core (shipped here as a prebuilt dynamic RVAFFI.xcframework) and renders the resolved scene with Core Graphics / Core Text.

The core decides what to draw (deterministic geometry for a viewport); this package decides how, using the native Apple graphics stack.

Requirements

  • iOS 15+ / macOS 13+
  • Swift 5.9+

Install

Add the package in Xcode (File → Add Package Dependencies…) or in Package.swift:

dependencies: [
    .package(url: "https://github.com/airovo/rva-swift", from: "0.1.0")
]

Usage

import RVA

// A path, a file:// URL, or an http(s):// URL.
let image = try RVAImage(source: "hero.rva")

// Resolve for a logical viewport (deterministic; matches every other runtime).
let scene = try image.resolve(width: 1280, height: 720)
print(scene.topology, scene.viability)

// Rasterize with Core Graphics.
let png = try RVARenderer.pngData(image: image, width: 1280, height: 720)
try png.write(to: URL(fileURLWithPath: "hero.png"))

RVAImage

Member Description
init(source:) Load a .rva from a path, file:// or http(s):// URL.
describe() Human-readable asset summary.
resolve(width:height:) Deterministic ResolvedScene for a viewport.
resource(_:) Raw bytes for a declared resource id.
hasResource(_:) / relativeFor(_:) Resource helpers.
renderPNG(width:height:) Optional PNG from the Rust core (instead of Core Graphics).

RVARenderer

Core Graphics / Core Text rasterizer: pngData(image:width:height:scale:) and render(image:scene:scale:).

Command-line renderer

swift run rva-render <asset.rva> [out-dir]

Renders the canonical viewport matrix (wide, desktop, tablet, square, mobile, ultrawide) to PNG.

How the core is provided

This package does not build the Rust core. Package.swift pins a specific core release's RVAFFI.xcframework by URL + checksum; the core repo (airovo/rva) builds and hosts it. To develop against a locally built core, build it in airovo/rva with scripts/build-xcframework.sh and switch the binary target to path: "RVAFFI.xcframework" (see the comment in Package.swift).

Maintainers

Release a new version with Actions → Release (inputs: a new version and the core_tag to pin). The workflow downloads that core's binary, recomputes the checksum, commits the pin, and tags the new version. See .github/workflows/release.yml.


RVA — Responsive Visual Asset, built by Airovo Technologies.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Oct 25 2026 14:21:06 GMT-0900 (Hawaii-Aleutian Daylight Time)