LookinAttribute.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // LookinAttribute.m
  3. // qmuidemo
  4. //
  5. // Created by Li Kai on 2018/11/17.
  6. // Copyright © 2018 QMUI Team. All rights reserved.
  7. //
  8. #import "LookinAttribute.h"
  9. #import "LookinDisplayItem.h"
  10. @implementation LookinAttribute
  11. #pragma mark - <NSCopying>
  12. - (id)copyWithZone:(NSZone *)zone {
  13. LookinAttribute *newAttr = [[LookinAttribute allocWithZone:zone] init];
  14. newAttr.identifier = self.identifier;
  15. newAttr.value = self.value;
  16. newAttr.attrType = self.attrType;
  17. return newAttr;
  18. }
  19. #pragma mark - <NSCoding>
  20. - (void)encodeWithCoder:(NSCoder *)aCoder {
  21. [aCoder encodeObject:self.identifier forKey:@"identifier"];
  22. [aCoder encodeInteger:self.attrType forKey:@"attrType"];
  23. [aCoder encodeObject:self.value forKey:@"value"];
  24. }
  25. - (instancetype)initWithCoder:(NSCoder *)aDecoder {
  26. if (self = [super init]) {
  27. self.identifier = [aDecoder decodeObjectForKey:@"identifier"];
  28. self.attrType = [aDecoder decodeIntegerForKey:@"attrType"];
  29. self.value = [aDecoder decodeObjectForKey:@"value"];
  30. }
  31. return self;
  32. }
  33. + (BOOL)supportsSecureCoding {
  34. return YES;
  35. }
  36. @end