I'm creating a CFMutableAttributedStringRef
with attributes and then passing this to Objective-C.
return (__bridge NSAttributedString *)myAttributedStringRef;
Most attributes like fonts have toll-free bridging with their Obj-C counterparts but not color attributes. NSForegroundColorAttributeName
and kCTForegroundColorAttributeName
do not bridge nor do UIColor
and CGColorRef
.
For example, I'm setting the text color like this but it doesn't bridge to it's Obj-C counterpart.
CFAttributedStringSetAttribute(string, range, kCTForegroundColorAttributeName, myCGColor);
Is it possible to somehow set the text color in core foundation and then pass this to Obj-C?