I\'m trying to add an underline to some text in my Swift app. This is the code I have currently:
let text = NSMutableAttributedString(string: self.currentHome.na
In Xcode 6.1, SDK iOS 8.1 toRaw()
has been replaced by rawValue
:
text.addAttribute(NSUnderlineStyleAttributeName, value: NSUnderlineStyle.StyleDouble.rawValue, range: NSMakeRange(0, text.length))
Or Easier :
var text : NSAttributedString = NSMutableAttributedString(string: str, attributes : [NSUnderlineStyleAttributeName: NSUnderlineStyle.StyleSingle.rawValue])