Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save raonivaladares/f0ef84e856696035122474779b16d798 to your computer and use it in GitHub Desktop.
Save raonivaladares/f0ef84e856696035122474779b16d798 to your computer and use it in GitHub Desktop.
final class UILabelFactory {
private let label: UILabel
private let defultFontSize: CGFloat = 20
// MARK: - Inits
init(text: String) {
label = UILabel()
label.textAlignment = .center
label.text = text
label.font = label.font.withSize(defultFontSize)
label.translatesAutoresizingMaskIntoConstraints = false
}
// MARK: - Public methods
func build() -> UILabel {
return label
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment