BTUIKCollectionReusableView.m 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. #import "BTUIKCollectionReusableView.h"
  2. #import "BTUIKAppearance.h"
  3. @implementation BTUIKCollectionReusableView
  4. - (instancetype)initWithFrame:(CGRect)frame
  5. {
  6. self = [super initWithFrame:frame];
  7. if (self) {
  8. self.label = [[UILabel alloc] init];
  9. self.label.translatesAutoresizingMaskIntoConstraints = NO;
  10. self.label.textAlignment = NSTextAlignmentCenter;
  11. self.label.font = [[BTUIKAppearance sharedInstance].font fontWithSize:12];
  12. self.label.textColor = [BTUIKAppearance sharedInstance].secondaryTextColor;
  13. [self addSubview:self.label];
  14. [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[label]|"
  15. options:0
  16. metrics:nil
  17. views:@{@"label":self.label}]];
  18. [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[label]|"
  19. options:0
  20. metrics:nil
  21. views:@{@"label":self.label}]];
  22. }
  23. return self;
  24. }
  25. @end