-
Notifications
You must be signed in to change notification settings - Fork 98
Closed
Description
Description
I am trying to build a RiveBuilder class which lets me load/cache Files and create rive objects. Unfortunately I am running into some issue with the experimental api
@_spi(RiveExperimental) import RiveRuntime
....
public func build(
_ animation: RiveAnimationFile,
dataBind: DataBind = .auto,
fit: Fit = .contain(alignment: .center)
) async throws -> Rive {
let file = try await loadFile(for: animation)
let artboard = try await file.createArtboard(animation.artboardName)
return try await Rive(
file: file,
artboard: artboard,
dataBind: dataBind,
fit: fit
)
}
All classes of the runtime error with
Cannot use enum 'DataBind' here; it is an SPI imported from 'RiveRuntime'
Cannot use enum 'Fit' here; it is an SPI imported from 'RiveRuntime'
Cannot use class 'Rive' here; it is an SPI imported from 'RiveRuntime'
Cannot use class 'File' here; it is an SPI imported from 'RiveRuntime'
I have imported correctly and I am using - 6.17.0
Any ideas ?
Solution
I had the class declared as final.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels