UIView+MASAdditions.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // UIView+MASAdditions.h
  3. // Masonry
  4. //
  5. // Created by Jonas Budelmann on 20/07/13.
  6. // Copyright (c) 2013 cloudling. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "MASConstraintBuilder.h"
  10. #import "MASViewAttribute.h"
  11. @interface UIView (MASAdditions)
  12. @property (nonatomic, strong, readonly) MASViewAttribute *mas_left;
  13. @property (nonatomic, strong, readonly) MASViewAttribute *mas_top;
  14. @property (nonatomic, strong, readonly) MASViewAttribute *mas_right;
  15. @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom;
  16. @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading;
  17. @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing;
  18. @property (nonatomic, strong, readonly) MASViewAttribute *mas_width;
  19. @property (nonatomic, strong, readonly) MASViewAttribute *mas_height;
  20. @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX;
  21. @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY;
  22. @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline;
  23. - (void)mas_buildConstraints:(void(^)(MASConstraintBuilder *constraints))block;
  24. @end
  25. #ifdef MAS_SHORTHAND
  26. @interface UIView (MASShortHandAdditions)
  27. @property (nonatomic, strong, readonly) MASViewAttribute *left;
  28. @property (nonatomic, strong, readonly) MASViewAttribute *top;
  29. @property (nonatomic, strong, readonly) MASViewAttribute *right;
  30. @property (nonatomic, strong, readonly) MASViewAttribute *bottom;
  31. @property (nonatomic, strong, readonly) MASViewAttribute *leading;
  32. @property (nonatomic, strong, readonly) MASViewAttribute *trailing;
  33. @property (nonatomic, strong, readonly) MASViewAttribute *width;
  34. @property (nonatomic, strong, readonly) MASViewAttribute *height;
  35. @property (nonatomic, strong, readonly) MASViewAttribute *centerX;
  36. @property (nonatomic, strong, readonly) MASViewAttribute *centerY;
  37. @property (nonatomic, strong, readonly) MASViewAttribute *baseline;
  38. - (void)buildConstraints:(void(^)(MASConstraintBuilder *constraints))block;
  39. @end
  40. #endif