0

Recently, I have updated to Xcode 7.0 and the following code which was working fine in Swift 1.2 is giving me error in Swift 2.0

let messageString = inString
let attributes = [UIFont(): UIFont.systemFontOfSize(15.0)]
let attrString:NSAttributedString? = NSAttributedString(string: messageString, attributes: attributes)

Can anyone know why?

1 Answer 1

4

Define your attributes this way:

    let attributes = [NSFontAttributeName: UIFont.systemFontOfSize(15.0)]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.