Monday, 9 March 2015

objective-c tableview - 2 (pull to fresh the page)



http://www.appcoda.com/pull-to-refresh-uitableview-empty/

since IOS 6, ios supported pull-to-fresh.

In tableview controller's viewDidLoad function:

    // Initialize the refresh control.
    self.refreshControl = [[UIRefreshControl alloc] init];
    self.refreshControl.backgroundColor = [UIColor purpleColor];
    self.refreshControl.tintColor = [UIColor whiteColor];
    [self.refreshControl addTarget:self
                    action:@selector(queryYOURDATA)
                  forControlEvents:UIControlEventValueChanged];




And you should manually close it:

[self.refreshControl endRefreshing];




No comments:

Post a comment