I'm trying to make a CATextLayer
accept NSBackGroundColorAttributeName
the attribute in an attributed string?
let mutableAttributed = NSMutableAttributedString(string: text , attributes: [
NSForegroundColorAttributeName : UIColor.redColor(),
NSBackgroundColorAttributeName : UIColor.whiteColor(),
NSFontAttributeName :UIFont.systemFontOfSize(12)
])
let textLayer = CATextLayer()
textLayer.needsDisplayOnBoundsChange = true
textLayer.string = mutableAttributed
textLayer.bounds.size = CGSizeMake(200,200)
But it simply doesn't work, reading Stack I've found a reasonable answer but is pretty old, and it doesn't seems to be fully clear, if from iOS6 it should support it or not.