Skip to content

Migrate the iOS new runtime off the data-binding APIs deprecated in rive-ios 6.28.0 #403

Open

Description

@mfazekas

rive-ios 6.28.0 (release notes) deprecates the concurrency data-binding API that ios/new/RiveReactNativeView.swift is built on. Everything still works on 6.28.0 (bumped in #401; the harness passes on both runtimes, warnings only), but these are slated for removal in a future release:

  • DataBind and Rive(file:artboard:stateMachine:dataBind:fit:) → pass explicitly bound components to Rive(file:artboard:stateMachine:)
  • StateMachine.bindViewModelInstance(_:) → try await stateMachine.bindViewModelInstances(main:globals:), which is async
  • Rive.viewModelInstance → create and retain the instance ourselves

Things the migration has to handle:

  1. dataBind auto and by-name must create the authored default instance explicitly, since getViewModelInstance() can no longer read it from Rive.
  2. Rebinding becomes async, which affects the dataBind-only change path and pendingBindInstance.
  3. Views now redraw automatically when bound instances change.

6.28.0 also adds global view models, font binding and blob binding, which we could expose once this is done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions