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..7af8165fd 100644 --- a/tns-core-modules/ui/animation/animation.ios.ts +++ b/tns-core-modules/ui/animation/animation.ios.ts @@ -41,10 +41,13 @@ interface IOSView extends viewModule.View { _isPresentationLayerUpdateSuspeneded(); } -class AnimationDelegateImpl extends NSObject { +class AnimationDelegateImpl extends NSObject implements CAAnimationDelegate { public nextAnimation: Function; + // The CAAnimationDelegate protocol has been introduced in the iOS 10 SDK + static ObjCProtocols = global.CAAnimationDelegate ? [global.CAAnimationDelegate] : []; + private _finishedCallback: Function; private _propertyAnimation: PropertyAnimationInfo; private _valueSource: number; @@ -360,7 +363,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);