From b316bc726012e1ffd13113bf0a06dfb60ca07c74 Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Wed, 14 Sep 2016 09:08:53 +0300 Subject: [PATCH] Fix delegates --- tests/app/ui/activity-indicator/activity-indicator-tests.ts | 6 +++++- tns-core-modules/ui/animation/animation.ios.ts | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/app/ui/activity-indicator/activity-indicator-tests.ts b/tests/app/ui/activity-indicator/activity-indicator-tests.ts index 0cdbfd4a3..c61166b88 100644 --- a/tests/app/ui/activity-indicator/activity-indicator-tests.ts +++ b/tests/app/ui/activity-indicator/activity-indicator-tests.ts @@ -81,6 +81,10 @@ function getNativeBusy(indicator: activityIndicatorModule.ActivityIndicator): bo return indicator.android.getVisibility() === android.view.View.VISIBLE; } else if (indicator.ios) { - return indicator.ios.isAnimating(); + if ((indicator.ios as any).isAnimating) { + return (indicator.ios as any).isAnimating(); + } else { + return (indicator.ios as UIActivityIndicatorView).animating; + } } } diff --git a/tns-core-modules/ui/animation/animation.ios.ts b/tns-core-modules/ui/animation/animation.ios.ts index 85034ab89..301227cd7 100644 --- a/tns-core-modules/ui/animation/animation.ios.ts +++ b/tns-core-modules/ui/animation/animation.ios.ts @@ -41,10 +41,12 @@ interface IOSView extends viewModule.View { _isPresentationLayerUpdateSuspeneded(); } -class AnimationDelegateImpl extends NSObject { +class AnimationDelegateImpl extends NSObject implements CAAnimationDelegate { public nextAnimation: Function; + static ObjCProtocols = [CAAnimationDelegate]; + private _finishedCallback: Function; private _propertyAnimation: PropertyAnimationInfo; private _valueSource: number; @@ -360,7 +362,7 @@ export class Animation extends common.Animation implements definition.Animation } let animationDelegate = AnimationDelegateImpl.initWithFinishedCallback(finishedCallback, animation, valueSource); - nativeAnimation.setValueForKey(animationDelegate, "delegate"); + nativeAnimation.delegate = animationDelegate; nativeView.layer.addAnimationForKey(nativeAnimation, args.propertyNameToAnimate);