I am overriding the func stateMachine(_: didChangeState: ) method of the RiveViewModel in my derived class to learn of state changes as the animation progress especially to detect when the animation ends. I was expecting the library to provide constant definitions for the possible values of the didChangeState parameter. I didn’t find any such constants in the documentation and I had to search through the library source code and experiment to learn that the didChangeState value will be “ExitState” at the end of the animation I had to define a constant for the “ExitState” string in my application code and use it to compare against the didChangeState parameter to detect when the animation is complete. The library should make available constant definitions for these state strings along with documentation describing each possible state. Without that the library providing a unique constant definition that both the client and the library itself uses it sets up a situation where my application can break silently should the name of the state be modified in a library update since there is no one true definition.
Hello,
I am overriding the func stateMachine(_: didChangeState: ) method of the RiveViewModel in my derived class to learn of state changes as the animation progress especially to detect when the animation ends. I was expecting the library to provide constant definitions for the possible values of the didChangeState parameter. I didn’t find any such constants in the documentation and I had to search through the library source code and experiment to learn that the didChangeState value will be “ExitState” at the end of the animation I had to define a constant for the “ExitState” string in my application code and use it to compare against the didChangeState parameter to detect when the animation is complete. The library should make available constant definitions for these state strings along with documentation describing each possible state. Without that the library providing a unique constant definition that both the client and the library itself uses it sets up a situation where my application can break silently should the name of the state be modified in a library update since there is no one true definition.