Created
July 10, 2017 11:23
-
-
Save malcolmkmd/7a8ddb04d352fbd6a9bfc74dbb97c4f0 to your computer and use it in GitHub Desktop.
String Extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import BonMot | |
extension String { | |
func styleTitle() -> NSAttributedString { | |
let style = StringStyle( | |
.font(UIFont(name: "Futura", size: 18)!), | |
.color(UIColor.white) | |
) | |
let attributedString = self.styled(with: style) | |
return attributedString | |
} | |
func styleHeading() -> NSAttributedString { | |
let style = StringStyle( | |
.font(UIFont(name: "Avenir-Black", size: 20)!), | |
.color(UIColor.red) | |
) | |
let attributedString = self.styled(with: style) | |
return attributedString | |
} | |
func stylePrice() -> NSAttributedString { | |
let style = StringStyle( | |
.font(UIFont(name: "Avenir-Black", size: 24)!), | |
.color(UIColor.lightGray) | |
) | |
let attributedString = self.styled(with: style) | |
return attributedString | |
} | |
func styleBody() -> NSAttributedString { | |
let style = StringStyle( | |
.font(UIFont(name: "Avenir", size: 14)!), | |
.color(UIColor.flatBlack) | |
) | |
let attributedString = self.styled(with: style) | |
return attributedString | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment