I\'m moving from swift 3 to swift 4. I have UILabels that I am giving very specific text properties to the label. I\'m getting an \'unexpectedly found nil while unwrapping
NSAttributedStringKey.strokeColor.rawValueis of typeString
NSAttributedStringKey.strokeColoris of typeNSAttributedStringKey
So its unable to convert String to NSAttributedStringKey .
You have to use like below:
let strokeTextAttributes: [NSAttributedStringKey : Any] = [
NSAttributedStringKey.strokeColor : UIColor.black,
NSAttributedStringKey.foregroundColor : UIColor.white,
NSAttributedStringKey.strokeWidth : -2.0,
NSAttributedStringKey.font : UIFont.boldSystemFont(ofSize: 18)
]