Runtimes · iOS and macOS

Interactive animation in SwiftUI.

The Swift package wraps the runtime in EggPlayer and draws it in a SwiftUI EggView, with a Metal-backed view for the GPU and an audio helper for sound events.

In short

On iOS and macOS, load an .egg with EggPlayer(data:), start a state machine, and show it with EggView(player:) in SwiftUI. Set inputs with setBool, setNumber and fire, and view model properties from your Swift code. The package also has a Metal-backed view and an audio helper for sound events.

Platform
iOS and macOS
Binding
Swift package (EggRuntime)
Draws with
Core Graphics image, or Metal
Same file everywhere
One .egg plays the same on every runtime
License
MIT or Apache-2.0

In SwiftUI

HatchView.swiftswift
import SwiftUI
import EggRuntime

struct HatchView: View {
    let player: EggPlayer

    init() throws {
        let url = Bundle.main.url(forResource: "hatch", withExtension: "egg")!
        player = try EggPlayer(data: Data(contentsOf: url))
        player.startStateMachine("hatch")
    }

    var body: some View {
        VStack {
            EggView(player: player)   // taps and drags reach the file's listeners
            Button("Hatch") { player.fire("tap") }
        }
    }
}

EggView forwards touches to the state machine's pointer listeners, so most files need no extra code; your own controls fire inputs directly.

Last checked against the product on 2026-10-15.

Examples you can play

All templates

Questions

Does it use the GPU?

It can. EggGPUView draws through Metal; EggView draws into a Core Graphics image.

Does it play sounds?

Yes. EggAudio plays the sound events the file reports.

What can my code change at run time?

State machine inputs (booleans, numbers, triggers), view model properties bound in the file (text, numbers, colours, enums, pictures, lists), and pictures, sounds and fonts handed over by your app. Your code also reads the current state and the events the file reports.

Is the runtime free to use in commercial apps?

Yes. The runtimes are licensed MIT or Apache-2.0, and what you make in the editor is yours.

Start with an egg.
Ship an interface.

Open the editor in your browser, or download it for macOS, Windows and Linux.