LookinDisplayItemDetail.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // LookinDisplayItemDetail.m
  3. // Lookin
  4. //
  5. // Created by Li Kai on 2019/2/19.
  6. // https://lookin.work
  7. //
  8. #import "LookinDisplayItemDetail.h"
  9. #if TARGET_OS_IPHONE
  10. #import "UIImage+LookinServer.h"
  11. #endif
  12. @implementation LookinDisplayItemDetail
  13. - (void)encodeWithCoder:(NSCoder *)aCoder {
  14. [aCoder encodeObject:@(self.displayItemOid) forKey:@"displayItemOid"];
  15. [aCoder encodeObject:self.groupScreenshot.lookin_data forKey:@"groupScreenshot"];
  16. [aCoder encodeObject:self.soloScreenshot.lookin_data forKey:@"soloScreenshot"];
  17. [aCoder encodeObject:self.frameValue forKey:@"frameValue"];
  18. [aCoder encodeObject:self.boundsValue forKey:@"boundsValue"];
  19. [aCoder encodeObject:self.hiddenValue forKey:@"hiddenValue"];
  20. [aCoder encodeObject:self.alphaValue forKey:@"alphaValue"];
  21. [aCoder encodeObject:self.attributesGroupList forKey:@"attributesGroupList"];
  22. }
  23. - (instancetype)initWithCoder:(NSCoder *)aDecoder {
  24. if (self = [super init]) {
  25. self.displayItemOid = [[aDecoder decodeObjectForKey:@"displayItemOid"] unsignedLongValue];
  26. self.groupScreenshot = [[LookinImage alloc] initWithData:[aDecoder decodeObjectForKey:@"groupScreenshot"]];
  27. self.soloScreenshot = [[LookinImage alloc] initWithData:[aDecoder decodeObjectForKey:@"soloScreenshot"]];
  28. self.frameValue = [aDecoder decodeObjectForKey:@"frameValue"];
  29. self.boundsValue = [aDecoder decodeObjectForKey:@"boundsValue"];
  30. self.hiddenValue = [aDecoder decodeObjectForKey:@"hiddenValue"];
  31. self.alphaValue = [aDecoder decodeObjectForKey:@"alphaValue"];
  32. self.attributesGroupList = [aDecoder decodeObjectForKey:@"attributesGroupList"];
  33. }
  34. return self;
  35. }
  36. + (BOOL)supportsSecureCoding {
  37. return YES;
  38. }
  39. @end