LookinDisplayItemDetail.m 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifdef SHOULD_COMPILE_LOOKIN_SERVER
  2. //
  3. // LookinDisplayItemDetail.m
  4. // Lookin
  5. //
  6. // Created by Li Kai on 2019/2/19.
  7. // https://lookin.work
  8. //
  9. #import "LookinDisplayItemDetail.h"
  10. #import "Image+Lookin.h"
  11. #if TARGET_OS_IPHONE
  12. #import "UIImage+LookinServer.h"
  13. #endif
  14. @implementation LookinDisplayItemDetail
  15. - (void)encodeWithCoder:(NSCoder *)aCoder {
  16. [aCoder encodeObject:@(self.displayItemOid) forKey:@"displayItemOid"];
  17. [aCoder encodeObject:self.groupScreenshot.lookin_data forKey:@"groupScreenshot"];
  18. [aCoder encodeObject:self.soloScreenshot.lookin_data forKey:@"soloScreenshot"];
  19. [aCoder encodeObject:self.frameValue forKey:@"frameValue"];
  20. [aCoder encodeObject:self.boundsValue forKey:@"boundsValue"];
  21. [aCoder encodeObject:self.hiddenValue forKey:@"hiddenValue"];
  22. [aCoder encodeObject:self.alphaValue forKey:@"alphaValue"];
  23. [aCoder encodeObject:self.attributesGroupList forKey:@"attributesGroupList"];
  24. [aCoder encodeObject:self.customAttrGroupList forKey:@"customAttrGroupList"];
  25. [aCoder encodeObject:self.customDisplayTitle forKey:@"customDisplayTitle"];
  26. [aCoder encodeObject:self.danceUISource forKey:@"danceUISource"];
  27. [aCoder encodeInteger:self.failureCode forKey:@"failureCode"];
  28. if (self.subitems) {
  29. [aCoder encodeObject:self.subitems forKey:@"subitems"];
  30. }
  31. }
  32. - (instancetype)initWithCoder:(NSCoder *)aDecoder {
  33. if (self = [super init]) {
  34. self.displayItemOid = [[aDecoder decodeObjectForKey:@"displayItemOid"] unsignedLongValue];
  35. self.groupScreenshot = [[LookinImage alloc] initWithData:[aDecoder decodeObjectForKey:@"groupScreenshot"]];
  36. self.soloScreenshot = [[LookinImage alloc] initWithData:[aDecoder decodeObjectForKey:@"soloScreenshot"]];
  37. self.frameValue = [aDecoder decodeObjectForKey:@"frameValue"];
  38. self.boundsValue = [aDecoder decodeObjectForKey:@"boundsValue"];
  39. self.hiddenValue = [aDecoder decodeObjectForKey:@"hiddenValue"];
  40. self.alphaValue = [aDecoder decodeObjectForKey:@"alphaValue"];
  41. self.attributesGroupList = [aDecoder decodeObjectForKey:@"attributesGroupList"];
  42. self.customAttrGroupList = [aDecoder decodeObjectForKey:@"customAttrGroupList"];
  43. self.customDisplayTitle = [aDecoder decodeObjectForKey:@"customDisplayTitle"];
  44. self.danceUISource = [aDecoder decodeObjectForKey:@"danceUISource"];
  45. if ([aDecoder containsValueForKey:@"failureCode"]) {
  46. self.failureCode = [aDecoder decodeIntegerForKey:@"failureCode"];
  47. } else {
  48. self.failureCode = 0;
  49. }
  50. if ([aDecoder containsValueForKey:@"subitems"]) {
  51. self.subitems = [aDecoder decodeObjectForKey:@"subitems"];
  52. }
  53. }
  54. return self;
  55. }
  56. + (BOOL)supportsSecureCoding {
  57. return YES;
  58. }
  59. @end
  60. #endif /* SHOULD_COMPILE_LOOKIN_SERVER */