Lottie for Swift Package Manager

repository·main·Indexed 41 days ago

https://github.com/airbnb/lottie-spm

A lightweight wrapper for integrating Lottie animations into iOS/Swift projects using Swift Package Manager (SPM). It provides a pointer to precompiled XCFrameworks from the lottie-ios release to ensure faster installation compared to building from the full source repository.

Tokens
552
Snippets
1
Records
4
Agent score
2%

What's inside Lottie

  1. Lottie Privacy and Privacy Manifests

    main

    Lottie does not collect any user data.

    To assist with App Store privacy reporting, Lottie includes a privacy manifest (PrivacyInfo.xcprivacy). When generating a privacy report, Xcode will automatically detect and use the privacy manifest included in the downloaded Lottie.xcframework. A copy is also available in this repository.

  2. Understand the difference between lottie-spm and lottie-ios

    main

    This repository (lottie-spm) is a lightweight wrapper designed specifically for Swift Package Manager.

    • lottie-spm: Much smaller (< 500kb) because it does not contain the full git history or source code. Instead, it points to a precompiled Lottie.xcframework (~8MB) from the latest lottie-ios release. This results in much faster download times.
    • lottie-ios: The main repository containing the full source code and git history (300+ MB). Use this repository if you prefer to build Lottie directly from source in your project.
  3. Install Lottie via Swift Package Manager

    main

    You can install Lottie using the Swift Package Manager (SPM) in two ways: through the Xcode GUI or by editing your Package.swift file.

    Using Xcode GUI

    1. In Xcode, select File → Add Packages...
    2. Enter the repository URL: https://github.com/airbnb/lottie-spm.git

    Using Package.swift

    Add the package dependency to your Package.swift and include the Lottie product in your target's dependencies.

    // In Package.swift
    .package(url: "https://github.com/airbnb/lottie-spm.git", from: "4.6.1")
    
    // In your target definition
    dependencies: [
      .product(name: "Lottie", package: "lottie-spm")
    ]
  4. Verify Lottie XCFramework security and authenticity

    main

    For versions 4.4.0 and later, Lottie XCFramework bundles include a code signature. The bundles are self-signed under the name "Lottie iOS".

    To validate the authenticity of a lottie-spm package:

    1. Confirm that the Package.swift file references a binary XCFramework from https://github.com/airbnb/lottie-ios/releases.
    2. Verify the fingerprint of the self-signed bundle.

    Fingerprint: 89 2F 1B 43 04 7B 50 53 8F 2F 46 EA D9 29 00 DD 3D 48 11 F358 21 78 C0 61 A5 FB 20 F1 11 CB 26