.clayzo bundles. There is no web view and nothing to fetch at runtime.
Versions match the npm packages:
clayzo-swift 0.3.6 plays what clayzo 0.3.6 authors and packages.
Install
In Xcode, choose File → Add Package Dependencies and enterhttps://github.com/Clayzo/clayzo-swift. Pick Up to Next Major from 0.3.6 and add the Clayzo library to your app target.
In a Package.swift:
Play a bundle
Package the document with the CLI, add the.clayzo file to your app’s resources, and play it:
isMuted: false to hear it. See Bundles for what goes into one.
You can also fetch a bundle over the network and pass the bytes to ClayzoBundle(data:); the file format is the same one the browser players load.
Play a document
A document with no fonts or images needs only its JSON:"*" for documents that name a font family without an asset. Fonts are registered once per app, not per player.
UIKit and AppKit
ClayzoPlayerView is the same player as a view you own:
Give the view the document’s aspect ratio; the document is scaled to fill it.
Interaction
Documents that declare interactivity respond to touch without any setup. A finger is the pointer: bindings follow it while it moves, a tap on a hit area is a click, and springs settle after it lifts. While a finger rests on an interactive document the player keeps the touch, so a drag drives the document rather than a navigation back-swipe or an enclosing scroll view. TurnisInteractionEnabled off for a player that should only be watched.
Hit-area events arrive as they happen:
event.kind is enter, leave, down, up or click; hitAreaId and nodeId name what was hit.
Declared inputs work as they do on the web:
.number, .boolean, .point(x, y) or .color(r, g, b, a).
Size and App Clips
The package adds about 1.4 MB to an app, so it fits comfortably inside an App Clip’s budget. Documents are separate: a bundle’s size is its images, fonts and audio. Package images at the size they are displayed rather than at their source resolution, and consider fetching bundles at runtime instead of shipping them in the clip — the limit applies to the installed clip, not to what it downloads.What renders
Everything the WebGL player draws: shapes, paths, text, images, gradients, clips, mattes, blend modes, blur and drop shadow, glass, refraction, dithering, duotone, pixelation, mesh gradients and custom shaders — including shaders that calltoLinearSrgb and fromLinearSrgb.
Not yet: Lottie nodes and a second finger (the first touch is the pointer).
Two things to know when authoring for phones:
- The player renders at the view’s size in device pixels, so a document shown at 390 pt on a 3× display renders at 1170 px wide. A custom shader that mixes device pixels and document units renders differently at different sizes; see Things that bite for how to write one that scales.
- A bundle with several font families uses the first as the fallback face for runs that name a family without an asset.

