Merge pull request #499 from ansman/fix/implement-init-with-coder-in-lotanimatedcontrol

Implement initWithCoder: in LOTAnimatedControl
This commit is contained in:
Brandon Withrow
2017-11-30 10:06:50 -08:00
committed by GitHub

View File

@@ -17,15 +17,27 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
_animationView = [[LOTAnimationView alloc] init];
_animationView.contentMode = UIViewContentModeScaleAspectFit;
_animationView.userInteractionEnabled = NO;
[self addSubview:_animationView];
_layerMap = [NSMutableDictionary dictionary];
[self _commonInit];
}
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
[self _commonInit];
}
return self;
}
- (void)_commonInit {
_animationView = [[LOTAnimationView alloc] init];
_animationView.contentMode = UIViewContentModeScaleAspectFit;
_animationView.userInteractionEnabled = NO;
[self addSubview:_animationView];
_layerMap = [NSMutableDictionary dictionary];
}
- (LOTComposition *)animationComp {
return _animationView.sceneModel;
}