LOTShapeCircle.m 873 B

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