airbnb / lottie-ios

An iOS library to natively render After Effects vector animations
http://airbnb.io/lottie/
Apache License 2.0
25.76k stars 3.75k forks source link

UIColor extension: lottieColorValue not available in visionOS #2279

Closed whiskey closed 10 months ago

whiskey commented 10 months ago

Which Version of Lottie are you using?

Lottie 4.3.4

Expected Behavior

The UIColor extension for the public var lottieColorValue: LottieColor is not available on visionOS. I expect the following statement to work:

let lottieColor = myUIColor.lottieColorValue

Actual Behavior

On visionOS 1.0 the compiler does not recognize the property.

Animation JSON

n/a

calda commented 10 months ago

@whiskey, this should be an easy fix. Any interest in posting a pull request?

I'd suggest changing the #if os(iOS) || os(tvOS) || os(watchOS) || targetEnvironment(macCatalyst) in that file to simply #if canImport(UIKit), which should work.

whiskey commented 10 months ago

I'm writing on the fix and am currently checking if there are any tests I have to cover.