MASViewAttribute.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // MASViewAttribute.h
  3. // Masonry
  4. //
  5. // Created by Jonas Budelmann on 21/07/13.
  6. // Copyright (c) 2013 cloudling. All rights reserved.
  7. //
  8. #import "MASUtilities.h"
  9. /**
  10. * An immutable tuple which stores the view and the related NSLayoutAttribute.
  11. * Describes part of either the left or right hand side of a constraint equation
  12. */
  13. @interface MASViewAttribute : NSObject
  14. /**
  15. * The view which the reciever relates to. Can be nil if item is not a view.
  16. */
  17. @property (nonatomic, weak, readonly) MAS_VIEW *view;
  18. /**
  19. * The item which the reciever relates to.
  20. */
  21. @property (nonatomic, weak, readonly) id item;
  22. /**
  23. * The attribute which the reciever relates to
  24. */
  25. @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute;
  26. /**
  27. * Convenience initializer.
  28. */
  29. - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute;
  30. /**
  31. * The designated initializer.
  32. */
  33. - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute;
  34. /**
  35. * Determine whether the layoutAttribute is a size attribute
  36. *
  37. * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight
  38. */
  39. - (BOOL)isSizeAttribute;
  40. @end