LookinObject.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifdef SHOULD_COMPILE_LOOKIN_SERVER
  2. //
  3. // LookinObject.h
  4. // Lookin
  5. //
  6. // Created by Li Kai on 2019/4/20.
  7. // https://lookin.work
  8. //
  9. #import <Foundation/Foundation.h>
  10. @class LookinObjectIvar, LookinIvarTrace;
  11. @interface LookinObject : NSObject <NSSecureCoding, NSCopying>
  12. #if TARGET_OS_IPHONE
  13. + (instancetype)instanceWithObject:(NSObject *)object;
  14. #endif
  15. @property(nonatomic, assign) unsigned long oid;
  16. @property(nonatomic, copy) NSString *memoryAddress;
  17. /**
  18. 比如有一个 UILabel 对象,则它的 classChainList 为 @[@"UILabel", @"UIView", @"UIResponder", @"NSObject"],而它的 ivarList 长度为 4,idx 从小到大分别是 UILabel 层级的 ivars, UIView 层级的 ivars.....
  19. */
  20. @property(nonatomic, copy) NSArray<NSString *> *classChainList;
  21. @property(nonatomic, copy) NSString *specialTrace;
  22. @property(nonatomic, copy) NSArray<LookinIvarTrace *> *ivarTraces;
  23. /// 没有 demangle,会包含 Swift Module Name
  24. /// 在 Lookin 的展示中,绝大多数情况下应该使用 lk_demangledSwiftName
  25. - (NSString *)rawClassName;
  26. @end
  27. #endif /* SHOULD_COMPILE_LOOKIN_SERVER */