Using unicorn icons in iOS/iPad OS

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

1. Add Lottie via Swift Package Manager

Go to your project settings → `"`Package Dependencies`"`
Add: https://github.com/airbnb/lottie-ios

2. Use the Animation

Replace `"`your_animation`"` with the name of your animation.

copy
import Lottie

class ViewController: UIViewController {
    var animationView: LottieAnimationView!

    override func viewDidLoad() {
        super.viewDidLoad()

        animationView = LottieAnimationView(name: "your_animation")
        animationView.frame = CGRect(x: 0, y: 0, width: 150, height: 150)
        animationView.center = view.center
        animationView.loopMode = .loop
        animationView.play()
        view.addSubview(animationView)
    }
}

3. Get Lottie Animations

Find free animations at Unicornicons.

We use cookies