Synny
Synny

Reputation: 542

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
                                                                                                   alpha:1.0]
                                                                            forKey:NSForegroundColorAttributeName];
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 !

Upvotes: 0

Views: 490

Answers (1)

vibhor
vibhor

Reputation: 111

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

try to put title in this method

Upvotes: 3

Related Questions