You could create your own styles using enums. By placing enums inside the Styles enum you get a nice grouping:
enum Styles {
enum Labels {
case Standard
case LargeText
func style(label: UILabel) {
switch self {
case .Standard:
label.font = UIFont.systemFontOfSize(12)
case .LargeText:
label.font = UIFont.systemFontOfSize(18)
}
}
}
enum Buttons {
case RedButton
func style(button: UIButton) {
switch self {
case .RedButton:
button.setTitleColor(UIColor.redColor(), forState: UIControlState.Normal)
}
}
}
}
Then you can use it like this:
Styles.Labels.Standard.style(yourLabel)
You can also then make extensions for the styles you have setup:
extension UILabel {
func style(style: Styles.Labels) {
style.style(self)
}
}
extension UIButton {
func style(style: Styles.Buttons) {
style.style(self)
}
}
And then use the extensions like this:
yourLabel.style(.Standard)
yourButton.style(.RedButton)