Rive · iOS

Rive in iOS

Embed interactive Rive animated icons in your iOS or iPadOS app using RiveViewModel and the Rive Swift Package.

1

Add Rive via Swift Package Manager

In Xcode, go to your project settings → Package Dependencies and add the Rive iOS package.

https://github.com/rive-app/rive-ios.git
2

Load the animation in your ViewController

Import RiveRuntime, create a RiveViewModel with your file name and state machine, then add the view to your layout.

copy
import RiveRuntime

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

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

Fire state machine inputs

Use the RiveViewModel to trigger animations and set boolean inputs in response to user interactions.

copy
// Fire a trigger input
riveModel.triggerInput("Trigger")

// Set a boolean input
riveModel.setBooleanInput("Hover", value: true)

// Read an input value
let isActive = riveModel.getBooleanInput("IsActive")
Get your icons
Browse animated icons ready for iOS.
Browse free icons →