TableViewTitleLabel.swift 674 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // TableViewTitleLabel.swift
  3. // LoopKitUI
  4. //
  5. // Created by Nathaniel Hamming on 2020-01-17.
  6. // Copyright © 2020 LoopKit Authors. All rights reserved.
  7. //
  8. import UIKit
  9. public class TableViewTitleLabel: UILabel {
  10. override public init(frame: CGRect) {
  11. super.init(frame: frame)
  12. initFont()
  13. }
  14. required public init?(coder: NSCoder) {
  15. super.init(coder: coder)
  16. initFont()
  17. }
  18. override public func awakeFromNib() {
  19. super.awakeFromNib()
  20. initFont()
  21. }
  22. public func initFont() {
  23. font = UIFont.titleFontGroupedInset
  24. self.adjustsFontForContentSizeCategory = true
  25. }
  26. }