Using unicorn icons in iOS/iPad OS

Learn how to integrate lottie animations into your android app effortlessly.

1. Add Rive via Swift Package Manager

Go to your project settings → `"`Package Dependencies`"`
Add: https://github.com/rive-app/rive-ios.git

2. Use in ViewController

copy
import RiveRuntime

class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()

        let riveView = RiveViewModel(fileName: "your_animation", stateMachineName: "State Machine 1")
        let riveUIView = riveView.createRiveView()
        riveUIView.frame = CGRect(x: 100, y: 100, width: 150, height: 150)
        view.addSubview(riveUIView)
    }
}

3. Control State Machines

copy
riveView.setInput("TriggerName", value: true)

4. Control State Machines

Find free animations at Unicornicons.

We use cookies