UIView+AutoLayoutDebugging.m 634 B

12345678910111213141516171819202122232425262728
  1. //
  2. // UIView+AutoLayoutDebugging.m
  3. // HeyLets
  4. //
  5. // Created by Jason Lee on 3/10/15.
  6. // Copyright (c) 2015 Jason Lee. All rights reserved.
  7. //
  8. @import ObjectiveC.runtime;
  9. #import "UIView+AutoLayoutDebugging.h"
  10. @implementation UIView (AutoLayoutDebugging)
  11. - (void)setLayoutDebuggingIdentifier:(NSString *)readableName {
  12. #ifdef DEBUG
  13. objc_setAssociatedObject(self, @"layoutDebuggingIdentifier",
  14. readableName, OBJC_ASSOCIATION_COPY_NONATOMIC);
  15. #endif
  16. }
  17. #ifdef DEBUG
  18. - (NSString *)_layoutDebuggingIdentifier {
  19. return objc_getAssociatedObject(self, @"layoutDebuggingIdentifier");
  20. }
  21. #endif
  22. @end