Peep
Peep

Reputation: 430

UIRefreshControl pull length

Looked around at stackoverflow but couldn't find a answer to this question: Is there any way to change how much a tableview has to be pulled down for the UIRefreshControl to start refreshing? Cause pulling 45% of the screen seems a little overkill.

Thanks in advance!

Upvotes: 11

Views: 3556

Answers (2)

BB9z
BB9z

Reputation: 2720

If you really needs change this behave, you can do like thie:

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    @try {
        [self.refreshControl setValue:@(60) forKey:@"_snappingHeight"];
    }
    @catch (NSException *exception) {
    }
}

More detail: https://stackoverflow.com/a/40461168/945906

Upvotes: 0

Gabriele Petronella
Gabriele Petronella

Reputation: 108169

There is no way of changing it using the UIRefreshControl component provided by Apple, since it's behavior is managed privately by the implementation of UITableViewController.

If you really want that kind of customization you may consider the open-source component ODRefreshControl and try to tweak its parameters.

Upvotes: 10

Related Questions