Change color to attributedTitle in UIRefreshControl
ios, ios6, nsattributedstring, uirefreshcontrol
Solution
You should be using `NSForegroundColorAttributeName`, not `kCTForegroundColorAttributeName`.
Also, the range being passed should be `NSMakeRange(0, [s length]);`.
Problem
I'm looking for a way to change color in `UIRefreshControl`. The text is shown in an `NSAttributedString`, so I try to use `CoreText.framework`: ``` NSString *s = @"Hello"; NSMutableAttributedString *a = [[NSMutableAttributedString alloc] initWithString:s]; [a addAttribute:(id)kCTForegroundColorAttributeName value:(id)[UIColor redColor].CGColor range:NSRangeFromString(s)]; refreshControl.attributedTitle = a; ``` The text is shown correctly, but the color is always the default gray. Any ideas ?