designengineer.ing100% left
designengineer.ing
Writing

Floating Balloon using Rive Scripting and Prototyped using SwiftUI

designengineer.ing

Build interactive balloon animations that respond to touch, using Rive's runtime and Scripting API inside a SwiftUI app. The result runs natively on iOS with smooth 60fps animations that feel right on device.

Prerequisites

  • Xcode 15+
  • Rive app (for creating/editing the animation)
  • Rive Swift package or SPM dependency
  • Basic SwiftUI and Swift familiarity

What you'll build

A phone-sized view with floating balloons that react when tapped. Each balloon uses a Rive animation with state driven by Rive Scripting. SwiftUI hosts the Rive view and passes touch/gesture data into the runtime.

Create the Rive animation

In Rive, design a balloon with idle and "popped" or "tapped" states. Use Rive Scripting to add interactive logic (e.g. onPointerDown, increment counters, trigger state machine inputs). Export the .riv file for use in your iOS project.

Add Rive to SwiftUI

Add the Rive Swift package to your project. Create a SwiftUI view that wraps RiveView and loads your .riv file. Ensure the view receives tap gestures and forwards them to the Rive runtime so your Scripting logic can respond.

Wire up interactions

Use Rive's runtime APIs to fire inputs or set numbers from Swift when the user taps. Your Rive Script can read these and update animation state. The video above shows the final result: balloons that feel responsive and native on the phone.

The Rive Script

Prompt used: "Red Balloons: Float up, collect at top, tap to pop!" β€” Here's the full Rive Scripting code that powers the balloons:

ArrowDateSelectorβ€Ίrive-balloons-script.lua
1-- Rive Script (see Copy/Download below)
SwiftLine 1, Col 1

Key parts: drawBalloonBody (teardrop shape), drawString (swaying string), pointerDown (tap-to-pop), and advance (float, collide, collect at top).

0 from readers

A shout out is a small burst of encouragement. When you tap πŸ“’, you let us know this tutorial helped β€” and that keeps us happy and motivated to write more like it.

design engineering@designengineerr
Follow
designengineer.ing

31 FollowingΒ·263 Followers

More tutorials

The dawn of new aesthetics - Part 1

Design engineering tutorial: a layer-by-layer Figma breakdown of Wojciech ZieliΕ„ski's glass arrow button β€” strokes, blur, shadow, and feel β€” with SwiftUI implementation in Chapter 2. For designers and engineers working in Figma and code.

Read now

The dawn of new aesthetics - Part 2

SwiftUI engineering breakdown of the glass arrow date selector β€” metrics, steel strokes, reflection, and motion β€” with open-source code in swiftuibuttons.

Read now

Explore

  • Glass arrow β€” Part 1
  • Glass arrow β€” Part 2
  • Rive balloons
  • YouTube Playground
  • Pinterest Playground

we are also on Follow

design engineer.ing

Β© 2026 design engineering

Β·Design engineering