FLEXCodeFontCell.m 809 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // FLEXCodeFontCell.m
  3. // FLEX
  4. //
  5. // Created by Tanner on 12/27/19.
  6. // Copyright © 2020 FLEX Team. All rights reserved.
  7. //
  8. #import "FLEXCodeFontCell.h"
  9. #import "UIFont+FLEX.h"
  10. @implementation FLEXCodeFontCell
  11. - (void)postInit {
  12. [super postInit];
  13. self.titleLabel.font = UIFont.flex_codeFont;
  14. self.subtitleLabel.font = UIFont.flex_codeFont;
  15. self.titleLabel.adjustsFontSizeToFitWidth = YES;
  16. self.titleLabel.minimumScaleFactor = 0.9;
  17. self.subtitleLabel.adjustsFontSizeToFitWidth = YES;
  18. self.subtitleLabel.minimumScaleFactor = 0.75;
  19. // Disable mutli-line pre iOS 11
  20. if (@available(iOS 11, *)) {
  21. self.subtitleLabel.numberOfLines = 5;
  22. } else {
  23. self.titleLabel.numberOfLines = 1;
  24. self.subtitleLabel.numberOfLines = 1;
  25. }
  26. }
  27. @end