Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for visionOS #12

Merged
merged 11 commits into from
Jan 22, 2024
Merged

Add support for visionOS #12

merged 11 commits into from
Jan 22, 2024

Conversation

calda
Copy link
Member

@calda calda commented Sep 12, 2023

This PR updates the structure of the lottie-spm package to support visionOS, and update CI to build for visionOS.

Lottie supports Xcode 14.1 and later. visionOS is supported by Xcode 15.2 and later. We ship a precompiled XCFramework bundle, so to support visionOS we must provide and use an XCFramework built by Xcode 15.2.

Xcode 14 can't use an XCFramework built by Xcode 15.2. Instead, we have to provide two XCFramework bundles:

  1. An XCFramework built by Xcode 15.2, which supports visionOS and can be used by Xcode 15.0+
  2. An XCFramework built by Xcode 14.1, which doesn't support visionOS but can be used by Xcode 14.

Following this policy, Lottie will only support Xcode 15.0+ starting in April 2024. At that point we can remove the additional XCFramework for Xcode 14, and instead just use the XCFramework built by Xcode 15.2.

A sidenote: I personally expected Xcode 15.0 to be unable to use an XCFramework built by Xcode 15.2, but all the testing I've done so far (including in GitHub actions CI) says that this works correctly. If this turns out to be an issue in practice we'll have to tweak the version gating.

Screenshot 2023-09-12 at 4 31 24 PM

import SwiftUI
import Lottie

struct ContentView: View {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted the separate iOS (UIKit) and macOS (AppKit) example apps in favor of a single cross-platform SwiftUI example app.

When we get ready to merge this we'll want to add CI jobs that test all supported platforms on both Xcode 14 and Xcode 15.

Package.swift Outdated Show resolved Hide resolved
@karanshah
Copy link

Hello! You can add a multiple swift Package files to support different swift versions. See this article. Also here is another example from an open source project. Hopefully this helps bringing in support for Swift 5.9

/// This XCFramework can be use by Xcode 15.0 and later.
let lottieXCFramework = Target.binaryTarget(
name: "Lottie",
url: "https://github.com/airbnb/lottie-ios/releases/download/4.3.4/Lottie.xcframework.zip",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The visionOS build will fail until we update this to a build of Lottie 4.4.0 (not released yet), but I tested this in CI with a custom XCFramework bundle built by Xcode 15.2 and confirmed that the current setup works:

image

@calda calda marked this pull request as ready for review January 22, 2024 20:42
@calda calda merged commit ff7dda2 into main Jan 22, 2024
8 of 10 checks passed
@calda calda deleted the cal--visionOS branch January 22, 2024 23:18
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Jan 23, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [airbnb/lottie-spm](https://togithub.com/airbnb/lottie-spm) | minor |
`from: "4.3.4"` -> `from: "4.4.0"` |

---

### Release Notes

<details>
<summary>airbnb/lottie-spm (airbnb/lottie-spm)</summary>

###
[`v4.4.0`](https://togithub.com/airbnb/lottie-spm/releases/tag/4.4.0)

[Compare
Source](https://togithub.com/airbnb/lottie-spm/compare/4.3.4...4.4.0)

#### New features

- Add privacy manifest
([https://github.com/airbnb/lottie-ios/pull/2252](https://togithub.com/airbnb/lottie-ios/pull/2252))
- Codesign Lottie.xcframework
([https://github.com/airbnb/lottie-ios/pull/2259](https://togithub.com/airbnb/lottie-ios/pull/2259))
- Add time remapping support to Core Animation rendering engine
([https://github.com/airbnb/lottie-ios/pull/2286](https://togithub.com/airbnb/lottie-ios/pull/2286))
- Add official visionOS support to lottie-ios repo
([https://github.com/airbnb/lottie-ios/pull/2287](https://togithub.com/airbnb/lottie-ios/pull/2287))
- lottie-spm now supports visionOS
([https://github.com/airbnb/lottie-spm/pull/12](https://togithub.com/airbnb/lottie-spm/pull/12))
- Adopt policy on minimum supported Swift / Xcode version, update
minimum versions to Swift 5.7 / Xcode 14.1
([https://github.com/airbnb/lottie-ios/pull/2260](https://togithub.com/airbnb/lottie-ios/pull/2260))

#### Bug fixes

- Update LottieView to display placeholder using `overlay` instead of
`ZStack`
([https://github.com/airbnb/lottie-ios/pull/2289](https://togithub.com/airbnb/lottie-ios/pull/2289))
- Fix issue where Core Animation rendering engine couldn't display last
frame of animation when paused
([https://github.com/airbnb/lottie-ios/pull/2254](https://togithub.com/airbnb/lottie-ios/pull/2254))
- Do not create `DotLottieImageProvider` instance if there's no image
files
([https://github.com/airbnb/lottie-ios/pull/2271](https://togithub.com/airbnb/lottie-ios/pull/2271))
- Mark DotLottieCache as Sendable
([https://github.com/airbnb/lottie-ios/pull/2245](https://togithub.com/airbnb/lottie-ios/pull/2245))
- Fix issue where AnimationKeypath in SolidLayer could be incorrect
([https://github.com/airbnb/lottie-ios/pull/2278](https://togithub.com/airbnb/lottie-ios/pull/2278))
- Fix issue where Repeater could be displayed incorrectly
([https://github.com/airbnb/lottie-ios/pull/2276](https://togithub.com/airbnb/lottie-ios/pull/2276))
- Include dSYMs in xcframework build
([https://github.com/airbnb/lottie-ios/pull/2284](https://togithub.com/airbnb/lottie-ios/pull/2284))
- Fix parsing issue, add support for DotLottieConfiguration in SwiftUI
LottieView
([https://github.com/airbnb/lottie-ios/pull/2277](https://togithub.com/airbnb/lottie-ios/pull/2277))
- Fix issue where DotLottieImageProvider didn't handle base64 images
([https://github.com/airbnb/lottie-ios/pull/2283](https://togithub.com/airbnb/lottie-ios/pull/2283))
- Fix issue where manually interpolated keyframes could animate
incorrectly
([https://github.com/airbnb/lottie-ios/pull/2285](https://togithub.com/airbnb/lottie-ios/pull/2285))

**Full Changelog**:
airbnb/lottie-ios@4.3.4...4.4.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDAuMCIsInVwZGF0ZWRJblZlciI6IjM2LjEwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Feb 22, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [airbnb/lottie-spm](https://togithub.com/airbnb/lottie-spm) | patch |
`from: "4.4.0"` -> `from: "4.4.1"` |

---

### Release Notes

<details>
<summary>airbnb/lottie-spm (airbnb/lottie-spm)</summary>

###
[`v4.4.1`](https://togithub.com/airbnb/lottie-spm/releases/tag/4.4.1)

[Compare
Source](https://togithub.com/airbnb/lottie-spm/compare/4.4.0...4.4.1)

##### Bug fixes in 4.4.1

- Replace os check with canImport so classes are available on visionOS
([https://github.com/airbnb/lottie-ios/pull/2294](https://togithub.com/airbnb/lottie-ios/pull/2294))
- Omit privacy manifest from source files in podspec
([https://github.com/airbnb/lottie-ios/pull/2307](https://togithub.com/airbnb/lottie-ios/pull/2307))
- Fix crash in Main Thread rendering engine path interpolation
implementation
([https://github.com/airbnb/lottie-ios/pull/2305](https://togithub.com/airbnb/lottie-ios/pull/2305))
- Fix warning from invalid character in Cocoapods resource bundle
identifier
([https://github.com/airbnb/lottie-ios/pull/2317](https://togithub.com/airbnb/lottie-ios/pull/2317))
- Fix infinite loop when setting `LottieAnimationView.viewportFrame`
([https://github.com/airbnb/lottie-ios/pull/2316](https://togithub.com/airbnb/lottie-ios/pull/2316))

##### New features in 4.4.0

- Add privacy manifest
([https://github.com/airbnb/lottie-ios/pull/2252](https://togithub.com/airbnb/lottie-ios/pull/2252))
- Codesign Lottie.xcframework
([https://github.com/airbnb/lottie-ios/pull/2259](https://togithub.com/airbnb/lottie-ios/pull/2259))
- Add time remapping support to Core Animation rendering engine
([https://github.com/airbnb/lottie-ios/pull/2286](https://togithub.com/airbnb/lottie-ios/pull/2286))
- Add official visionOS support to lottie-ios repo
([https://github.com/airbnb/lottie-ios/pull/2287](https://togithub.com/airbnb/lottie-ios/pull/2287))
- lottie-spm now supports visionOS
([https://github.com/airbnb/lottie-spm/pull/12](https://togithub.com/airbnb/lottie-spm/pull/12))
- Adopt policy on minimum supported Swift / Xcode version, update
minimum versions to Swift 5.7 / Xcode 14.1
([https://github.com/airbnb/lottie-ios/pull/2260](https://togithub.com/airbnb/lottie-ios/pull/2260))

**Full Changelog**:
airbnb/lottie-ios@4.4.0...4.4.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDAuMCIsInVwZGF0ZWRJblZlciI6IjM2LjEwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Apr 8, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [airbnb/lottie-spm](https://togithub.com/airbnb/lottie-spm) | patch |
`from: "4.4.1"` -> `from: "4.4.2"` |

---

### Release Notes

<details>
<summary>airbnb/lottie-spm (airbnb/lottie-spm)</summary>

###
[`v4.4.2`](https://togithub.com/airbnb/lottie-spm/releases/tag/4.4.2)

[Compare
Source](https://togithub.com/airbnb/lottie-spm/compare/4.4.1...4.4.2)

##### Changes in 4.4.2

- Update minimum deployment target to iOS 13.0 / macOS 10.15
([https://github.com/airbnb/lottie-ios/pull/2322](https://togithub.com/airbnb/lottie-ios/pull/2322))
- Add privacy manifest to lottie-spm repo
([https://github.com/airbnb/lottie-spm/pull/23](https://togithub.com/airbnb/lottie-spm/pull/23))
- Add visionOS support to Cocoapods podspec
([https://github.com/airbnb/lottie-ios/pull/2348](https://togithub.com/airbnb/lottie-ios/pull/2348))
- Fix incorrect usage of `State(initialValue:)` in `LottieView`
([https://github.com/airbnb/lottie-ios/pull/2357](https://togithub.com/airbnb/lottie-ios/pull/2357))
- Use correct version number when building XCFramework bundle
([https://github.com/airbnb/lottie-ios/pull/2341](https://togithub.com/airbnb/lottie-ios/pull/2341))

##### New features in 4.4.0

- Add privacy manifest
([https://github.com/airbnb/lottie-ios/pull/2252](https://togithub.com/airbnb/lottie-ios/pull/2252))
- Codesign Lottie.xcframework
([https://github.com/airbnb/lottie-ios/pull/2259](https://togithub.com/airbnb/lottie-ios/pull/2259))
- Add time remapping support to Core Animation rendering engine
([https://github.com/airbnb/lottie-ios/pull/2286](https://togithub.com/airbnb/lottie-ios/pull/2286))
- Add official visionOS support to lottie-ios repo
([https://github.com/airbnb/lottie-ios/pull/2287](https://togithub.com/airbnb/lottie-ios/pull/2287))
- lottie-spm now supports visionOS
([https://github.com/airbnb/lottie-spm/pull/12](https://togithub.com/airbnb/lottie-spm/pull/12))
- Adopt policy on minimum supported Swift / Xcode version, update
minimum versions to Swift 5.7 / Xcode 14.1
([https://github.com/airbnb/lottie-ios/pull/2260](https://togithub.com/airbnb/lottie-ios/pull/2260))

**Full Changelog**:
airbnb/lottie-ios@4.4.1...4.4.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Apr 16, 2024
)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [airbnb/lottie-spm](https://togithub.com/airbnb/lottie-spm) | patch |
`from: "4.4.2"` -> `from: "4.4.3"` |

---

### Release Notes

<details>
<summary>airbnb/lottie-spm (airbnb/lottie-spm)</summary>

###
[`v4.4.3`](https://togithub.com/airbnb/lottie-spm/releases/tag/4.4.3)

[Compare
Source](https://togithub.com/airbnb/lottie-spm/compare/4.4.2...4.4.3)

##### Bug fixes in 4.4.3

- Fix issue where animation size could be incorrect after loading async
animation
([https://github.com/airbnb/lottie-ios/pull/2379](https://togithub.com/airbnb/lottie-ios/pull/2379))
- Update NSPrivacyAccessedAPITypeReasons in privacy manifest
([https://github.com/airbnb/lottie-ios/pull/2380](https://togithub.com/airbnb/lottie-ios/pull/2380))
- Include animation duration when computing cost/complexity of Core
Animation time remapping
([https://github.com/airbnb/lottie-ios/pull/2381](https://togithub.com/airbnb/lottie-ios/pull/2381))

##### New features in 4.4.0

- Add privacy manifest
([https://github.com/airbnb/lottie-ios/pull/2252](https://togithub.com/airbnb/lottie-ios/pull/2252))
- Codesign Lottie.xcframework
([https://github.com/airbnb/lottie-ios/pull/2259](https://togithub.com/airbnb/lottie-ios/pull/2259))
- Add time remapping support to Core Animation rendering engine
([https://github.com/airbnb/lottie-ios/pull/2286](https://togithub.com/airbnb/lottie-ios/pull/2286))
- Add official visionOS support to lottie-ios repo
([https://github.com/airbnb/lottie-ios/pull/2287](https://togithub.com/airbnb/lottie-ios/pull/2287))
- lottie-spm now supports visionOS
([https://github.com/airbnb/lottie-spm/pull/12](https://togithub.com/airbnb/lottie-spm/pull/12))
- Adopt policy on minimum supported Swift / Xcode version, update
minimum versions to Swift 5.7 / Xcode 14.1
([https://github.com/airbnb/lottie-ios/pull/2260](https://togithub.com/airbnb/lottie-ios/pull/2260))

**Full Changelog**:
airbnb/lottie-ios@4.4.2...4.4.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants