Add NSUnderlineStyle.PatternDash to NSAttributedString in Swift?
问题 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.name) let attrs = [NSUnderlineStyleAttributeName:NSUnderlineStyle.PatternDash] text.addAttributes(attrs, range: NSMakeRange(0, text.length)) homeLabel.attributedText = text But I get this error on the text.addAttributes line: NSString is not identical to NSObject How can I add an attribute contained in an enum to an