Skip to content

Commit c0fcda6

Browse files
committed
fix(ios): multiple iOS fixes
1 parent 0b8963b commit c0fcda6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/lottie.ios.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ import { clamp } from './utils';
1919

2020
const appPath = knownFolders.currentApp().path;
2121

22+
// this remove assert for lottie allowing sync .lottie files loading on main thread
23+
CompatibleLottieLogger.overrideLottieLogger();
24+
2225
export class LottieView extends LottieViewBase {
2326
nativeViewProtected: CompatibleAnimationView;
2427
private _imageSourceAffectsLayout = true;
@@ -69,7 +72,9 @@ export class LottieView extends LottieViewBase {
6972
this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithFilepath(src);
7073
}
7174
}
72-
75+
if (this.keyPathColors) {
76+
this[keyPathColorsProperty.setNative](this.keyPathColors);
77+
}
7378
if (this._imageSourceAffectsLayout) {
7479
this.requestLayout();
7580
}

src/typings/ios.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/unified-signatures */
12
declare class AnimatedButton extends AnimatedControl {
23
static alloc(): AnimatedButton; // inherited from NSObject
34

@@ -292,6 +293,14 @@ declare class CompatibleDictionaryTextProvider extends NSObject {
292293
initWithValues(values: NSDictionary<string, string>): this;
293294
}
294295

296+
declare class CompatibleLottieLogger extends NSObject {
297+
static alloc(): CompatibleLottieLogger; // inherited from NSObject
298+
299+
static new(): CompatibleLottieLogger; // inherited from NSObject
300+
301+
static overrideLottieLogger(): void;
302+
}
303+
295304
declare const enum CompatibleRenderingEngineOption {
296305
Shared = 0,
297306

0 commit comments

Comments
 (0)