MASViewConstraint.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // MASViewConstraint.h
  3. // Masonry
  4. //
  5. // Created by Jonas Budelmann on 20/07/13.
  6. // Copyright (c) 2013 cloudling. All rights reserved.
  7. //
  8. #import "MASViewAttribute.h"
  9. #import "MASConstraint.h"
  10. #import "MASLayoutConstraint.h"
  11. #import "MASUtilities.h"
  12. /**
  13. * A single constraint.
  14. * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view
  15. */
  16. @interface MASViewConstraint : MASConstraint <NSCopying>
  17. /**
  18. * First item/view and first attribute of the NSLayoutConstraint
  19. */
  20. @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute;
  21. /**
  22. * Second item/view and second attribute of the NSLayoutConstraint
  23. */
  24. @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute;
  25. /**
  26. * initialises the MASViewConstraint with the first part of the equation
  27. *
  28. * @param firstViewAttribute view.mas_left, view.mas_width etc.
  29. *
  30. * @return a new view constraint
  31. */
  32. - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute;
  33. /**
  34. * Returns all MASViewConstraints installed with this view as a first item.
  35. *
  36. * @param view A view to retrieve constraints for.
  37. *
  38. * @return An array of MASViewConstraints.
  39. */
  40. + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view;
  41. @end