Synny Synny - 10 months ago 64
iOS Question

Change UIRefreshControl title before showing it - Objective-c iOS

Is it possible to change the UIRefreshControl title before it appear on screen ?

Actually, I use this code to change the title in my update method :

NSString *refreshControlTitle = @"Pull to refresh...No new item to show";
NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObject:[UIColor colorWithRed:0.35 green:0.78 blue:0.98
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:refreshControlTitle attributes:attrsDictionary];
refreshControl.attributedTitle = attributedTitle;

(Some text changes are done depending on the situation), but the text is only changing after the refresh is done.

How could I do to actualize the text just before the user begin to see the refreshControl ?

Thanks in advance !

- (void) scrollViewWillBeginDragging:(UIScrollView *)scrollView {

try to put title in this method