Here is the text:
@IBOutlet weak var legalText: UITextView!
let textToAppend = \"TERMS OF SERVICE\\nLast Updated: May 7, 2015\\n\\nPLEASE NOTE: The HIGO Term
Swift 4.2 Update
func addBoldText(fullString: String, boldPartOfString: String, baseFont: UIFont, boldFont: UIFont) -> NSAttributedString {
//1
let baseFontAttribute = [NSAttributedString.Key.font : baseFont]
let boldFontAttribute = [NSAttributedString.Key.font : boldFont]
//2
let attributedString = NSMutableAttributedString(string: fullString, attributes: baseFontAttribute)
//3. Note if 'boldPartOfString' is not a substring of 'fullString', enitre 'fullString' will be formatted with 'boldFont'
attributedString.addAttributes(boldFontAttribute, range: NSRange(fullString.range(of: boldPartOfString) ?? fullString.startIndex..