rive-app / rive-ios

iOS runtime for Rive
MIT License
462 stars 53 forks source link

is it possible for two animations from different files to exist? #324

Open IzabourAzevedo opened 1 month ago

IzabourAzevedo commented 1 month ago

is it possible for two animations from different files to exist? and they work separately but as soon as i say i need one to be enabled only in long press it doesn't work.

RiveRuntime/RiveViewModel.swift:213: Fatal error: 'try!' expression unexpectedly raised an error: RiveRuntime.RiveModel.RiveModelError.invalidAnimation("Name hana not found")

VStack { if isLongPressed { secondaryRiveViewModel.view() .frame(width: 360, height: 136) .onAppear { secondaryRiveViewModel.play(animationName: "hanasad") } } else { riveViewModel.view() .frame(width: 360, height: 136) .onAppear { setupRive() } } } .gesture( LongPressGesture(minimumDuration: 1.0) .onChanged { in handleLongPress() } .onEnded { in isLongPressed = false } ) }