Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let attrString = NSMutableAttributedString(string: text + phone, attributes: nil)
- let rangeText = (attrString.string as NSString).range(of: text)
- let rangePhone = (attrString.string as NSString).range(of: phone)
- attrString.setAttributes([NSAttributedStringKey.foregroundColor: UIColor.red], range: rangeText)
- attrString.setAttributes([NSAttributedStringKey.foregroundColor: UIColor.brown,
- NSAttributedStringKey.underlineStyle: NSUnderlineStyle.styleSingle.rawValue],
- range: rangePhone)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement