Migrating from 2.x.x to 3.x.x
Migrating guide from < 3.x
Migrating to v3 of the iOS runtime should be fairly straightforward. See the sections below on concerns you may need to look out for to change to your app if you upgrade.
Enums Naming
Starting in v3, the Layout option enums have changed to match enum naming conventions from the other runtimes for consistency. See below for what you should change Fit
and Alignment
options to. There are also a few other enums for parameters that have changed slightly regarding loop modes and direction.
Fit | Before | After |
---|---|---|
Fill |
|
|
Contain |
|
|
Cover |
|
|
Fit Width |
|
|
Fit Height |
|
|
Scale Down |
|
|
None |
|
|
Alignment | Before | After |
---|---|---|
Top Left |
|
|
Top Center |
|
|
Top Right |
|
|
Center Left |
|
|
Center |
|
|
Center Right |
|
|
Bottom Left |
|
|
Bottom Center |
|
|
Bottom Right |
|
|
Loop Mode | Before | After |
---|---|---|
One Shot |
|
|
Loop |
|
|
Ping Pong |
|
|
Auto |
|
|
Direction | Before | After |
---|---|---|
Backwards |
|
|
Forwards |
|
|
Auto |
|
|
Default playing behavior
One changed default behavior in v3 is what plays in the Rive canvas. Before v3, if no state machine or specific animation was specified when setting up the RiveViewModel
, the first animation made in the Rive file would play.
With v3, if no state machine or specific animation is specified, the first state machine (if one is created) in the Rive file will play. So if you prefer to keep your existing default behavior of the first animation, simply set the animationName
property on RiveViewModel
when creating it.