LOTShapeCircle.m
873 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// LOTShapeCircle.m
// LottieAnimator
//
// Created by Brandon Withrow on 12/15/15.
// Copyright © 2015 Brandon Withrow. All rights reserved.
//
#import "LOTShapeCircle.h"
@implementation LOTShapeCircle
- (instancetype)initWithJSON:(NSDictionary *)jsonDictionary {
self = [super init];
if (self) {
[self _mapFromJSON:jsonDictionary];
}
return self;
}
- (void)_mapFromJSON:(NSDictionary *)jsonDictionary {
if (jsonDictionary[@"nm"] ) {
_keyname = [jsonDictionary[@"nm"] copy];
}
NSDictionary *position = jsonDictionary[@"p"];
if (position) {
_position = [[LOTKeyframeGroup alloc] initWithData:position];
}
NSDictionary *size= jsonDictionary[@"s"];
if (size) {
_size = [[LOTKeyframeGroup alloc] initWithData:size];
}
NSNumber *reversed = jsonDictionary[@"d"];
_reversed = (reversed.integerValue == 3);
}
@end