Last active
March 8, 2018 10:03
-
-
Save tonespy/8baabe87ca260fc85a53511241c70ac1 to your computer and use it in GitHub Desktop.
MutableStrings
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
let aggreementLabel: UILabel = { | |
let label = UILabel() | |
label.font = UIFont.systemFont(ofSize: 15) | |
label.textColor = UIColor.textfieldTextColor() | |
label.numberOfLines = 0 | |
let titles = ["I agree to the", " terms and conditions", " and confirm that the information I have provided is accurate."] | |
let colors = [UIColor.authTextGray(), UIColor.appColor(), UIColor.authTextGray()] | |
let attributedText = NSMutableAttributedString().generateMultipleColorString(sentences: titles, colors: colors) | |
if let attributedText = attributedText { | |
label.attributedText = attributedText | |
} | |
label.translatesAutoresizingMaskIntoConstraints = false | |
return label | |
}() | |
let signupField: UIButton = { | |
let button = UIButton() | |
let titles = ["don't have an account?", " Sign up"] | |
let colors = [UIColor.authTextGray(), UIColor.appColor()] | |
let attributedText = NSMutableAttributedString().generateMultipleColorString(sentences: titles, colors: colors) | |
if let attributedText = attributedText { | |
button.setAttributedTitle(attributedText, for: .normal) | |
} | |
button.titleLabel?.font = UIFont.systemFont(ofSize: 15) | |
button.translatesAutoresizingMaskIntoConstraints = false | |
return button | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment