From dbfa09f8effebc2f87a0fccba9db23b095a1b8a1 Mon Sep 17 00:00:00 2001 From: Tsvetan Raikov Date: Wed, 3 Feb 2016 14:52:29 +0200 Subject: [PATCH] Changed how AnimationDelegateImpl is created to be in sync with the new approach --- ui/animation/animation.ios.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ui/animation/animation.ios.ts b/ui/animation/animation.ios.ts index d4b149ed6..7b4cd9a78 100644 --- a/ui/animation/animation.ios.ts +++ b/ui/animation/animation.ios.ts @@ -12,19 +12,17 @@ var _skip = "_skip"; var FLT_MAX = 340282346638528859811704183484516925440.000000; class AnimationDelegateImpl extends NSObject { - static new(): AnimationDelegateImpl { - return super.new(); - } public nextAnimation: Function; private _finishedCallback: Function; private _propertyAnimation: common.PropertyAnimation; - public initWithFinishedCallback(finishedCallback: Function, propertyAnimation: common.PropertyAnimation): AnimationDelegateImpl { - this._finishedCallback = finishedCallback; - this._propertyAnimation = propertyAnimation; - return this; + public static initWithFinishedCallback(finishedCallback: Function, propertyAnimation: common.PropertyAnimation): AnimationDelegateImpl { + let delegate = AnimationDelegateImpl.new(); + delegate._finishedCallback = finishedCallback; + delegate._propertyAnimation = propertyAnimation; + return delegate; } animationDidStart(anim: CAAnimation): void { @@ -242,7 +240,7 @@ export class Animation extends common.Animation implements definition.Animation nativeAnimation.timingFunction = animation.curve; } - var animationDelegate: AnimationDelegateImpl = AnimationDelegateImpl.new().initWithFinishedCallback(finishedCallback, animation); + var animationDelegate: AnimationDelegateImpl = AnimationDelegateImpl.initWithFinishedCallback(finishedCallback, animation); nativeAnimation.setValueForKey(animationDelegate, "delegate"); nativeView.layer.addAnimationForKey(nativeAnimation, null);