NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MMM d, h:mm a"];
NSString *title = [NSString stringWithFormat:@"Last update: %@", [formatter stringFromDate:[NSDate date]]];
NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObject:[UIColor whiteColor]
forKey:NSForegroundColorAttributeName];
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:title attributes:attrsDictionary];
self.refreshControl.attributedTitle = attributedTitle;
Monday, 28 July 2014
Title for refresh controller (UIRefreshControl)
Subscribe to:
Post Comments (Atom)
_refreshControl = [UIRefreshControl new];
ReplyDelete[self.refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged];
[self.tableView addSubview:self.refreshControl];
[self.tableView sendSubviewToBack:self.refreshControl];
self.refreshControl.tintColor = [UIColor greenColor];
self.refreshControl.backgroundColor =[UIColor grayColor];