1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-03 09:57:46 +01:00
Telegram/legacy/TelegraphKit/TGAnimationBlockDelegate.m

38 lines
692 B
Mathematica
Raw Normal View History

2015-10-01 18:19:52 +02:00
#import "TGAnimationBlockDelegate.h"
@implementation TGAnimationBlockDelegate
- (instancetype)initWithLayer:(CALayer *)layer
{
self = [super init];
if (self != nil)
{
_layer = layer;
}
return self;
}
- (void)animationDidStart:(CAAnimation *)__unused anim
{
}
- (void)animationDidStop:(CAAnimation *)__unused anim finished:(BOOL)flag
{
CALayer *layer = _layer;
if (flag)
{
if (_opacityOnCompletion != nil)
layer.opacity = [_opacityOnCompletion floatValue];
}
if (_removeLayerOnCompletion)
[layer removeFromSuperlayer];
if (_completion)
_completion(flag);
_completion = nil;
}
@end