This worked before upgrading to Swift 1.2 and Xcode 6.3.
var mutString : NSMutableAttributedString = NSMutableAttributedString(string: "K2")
mutString.addAttribute(kCTSuperscriptAttributeName, value:-1, range:NSMakeRange(1, 1))
var result : String = mutString.string
The result should contain the string K2 (with "2" as the index).
But now I get this error:
Cannot be called addAttributeusing argument list of type'(CFString!, value:Int, range:NSRange)'
Please indicate me the correct solution / documentation.
source
share