LookinDisplayItemDetail.m 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. }
  25. - (instancetype)initWithCoder:(NSCoder *)aDecoder {
  26. if (self = [super init]) {
  27. self.displayItemOid = [[aDecoder decodeObjectForKey:@"displayItemOid"] unsignedLongValue];
  28. self.groupScreenshot = [[LookinImage alloc] initWithData:[aDecoder decodeObjectForKey:@"groupScreenshot"]];
  29. self.soloScreenshot = [[LookinImage alloc] initWithData:[aDecoder decodeObjectForKey:@"soloScreenshot"]];
  30. self.frameValue = [aDecoder decodeObjectForKey:@"frameValue"];
  31. self.boundsValue = [aDecoder decodeObjectForKey:@"boundsValue"];
  32. self.hiddenValue = [aDecoder decodeObjectForKey:@"hiddenValue"];
  33. self.alphaValue = [aDecoder decodeObjectForKey:@"alphaValue"];
  34. self.attributesGroupList = [aDecoder decodeObjectForKey:@"attributesGroupList"];
  35. }
  36. return self;
  37. }
  38. + (BOOL)supportsSecureCoding {
  39. return YES;
  40. }
  41. @end
  42. #endif /* SHOULD_COMPILE_LOOKIN_SERVER */