Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to add a Refresh Control on a tableView

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 473
    Comment on it

    Hi Readers,

     

    To refresh the table whenever you pull down the table, we need to use Refresh Control.

    To add a UIRefreshControl on a TableView you just have to add a below code in your viewController.

     

    UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
    
    [refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
    
    [tableView addSubview:refreshControl];

     

    Now in the selector method refresh:You can code according to your project what you need on the table refresh.

     

    - (void)refresh:(UIRefreshControl *)refreshControl
    {
    // Do your job, when done:
    }

    Thanx for reading..:)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: