rive-app / rive-ios

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

Getting issue Animation work fine in preview but not working on iOS code #325

Open Spatel91111 opened 1 month ago

Spatel91111 commented 1 month ago

I have one "riv" file and it's working fine on https://rive.app/preview/ but on iOS swift code it's not working

I have add code as below

import UIKit import RiveRuntime

class ViewController: UIViewController {

let riveModel = RiveViewModel(fileName: "loading_loop", autoPlay: true)

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    let riveView = self.riveModel.createRiveView()
    self.view.addSubview(riveView)
    riveView.frame = self.view.bounds
}

}

For library Install latest SPM