From ef3152dddb305ba3274b458edce064e6b2065e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Thu, 26 Feb 2026 17:20:21 +0100 Subject: [PATCH] fix(ios): restart render loop after setting state machine inputs (#161) On iOS, when a state machine settles (isPlaying=false), setting an input doesn't restart the render loop so the change is never visually processed. Android handles this via its controller queue. This adds playIfNeeded() to the three input setters to match Android behavior. Fixes #161 --- ios/RiveReactNativeView.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/RiveReactNativeView.swift b/ios/RiveReactNativeView.swift index 98fd839f..a74ba50d 100644 --- a/ios/RiveReactNativeView.swift +++ b/ios/RiveReactNativeView.swift @@ -166,6 +166,7 @@ class RiveReactNativeView: UIView, RiveStateMachineDelegate { try handleInput(name: name, path: path, type: .number) { (input: RiveRuntime.RiveSMINumber) in input.setValue(value) } + playIfNeeded() } func getNumberInputValue(name: String, path: String?) throws -> Float { @@ -178,6 +179,7 @@ class RiveReactNativeView: UIView, RiveStateMachineDelegate { try handleInput(name: name, path: path, type: .boolean) { (input: RiveRuntime.RiveSMIBool) in input.setValue(value) } + playIfNeeded() } func getBooleanInputValue(name: String, path: String?) throws -> Bool { @@ -190,6 +192,7 @@ class RiveReactNativeView: UIView, RiveStateMachineDelegate { try handleInput(name: name, path: path, type: .trigger) { (input: RiveRuntime.RiveSMITrigger) in input.fire() } + playIfNeeded() } func setTextRunValue(name: String, value: String, path: String?) throws {