a guest Sep 17th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func underLine(subString: String) {
  2.         if let range = self.string.range(of: subString) {
  3.             self.underLine(onRange: NSRange(range, in: self.string))
  4.         }
  5.     }
  6.     func underLine(onRange: NSRange) {
  7.         self.addAttributes([NSAttributedString.Key.underlineStyle: NSUnderlineStyle.single.rawValue],
  8.                            range: onRange)
  9.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand