Skip to content

Instantly share code, notes, and snippets.

@rldaulton
Created February 6, 2019 00:17
Show Gist options
  • Save rldaulton/3aedfdf5c6e8a96b221d19509a27d750 to your computer and use it in GitHub Desktop.
Save rldaulton/3aedfdf5c6e8a96b221d19509a27d750 to your computer and use it in GitHub Desktop.
An example of a mould, using a UILabel
// Mould
extension UILabel {
class var heading: UILabel {
let mould: UILabel = .init()
mould.font = .systemFont(ofSize: 18.0)
mould.textColor = .black
mould.translatesAutoresizingMaskIntoConstraints = false
return mould
}
}
//How to use
let headingLabel: UILabel = .heading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment