I have a UIViewController that has a UITableView as a subview. I am trying to add a pull-to-refresh on the table.
Following some examples and discussions that I found here, I have the UIRefresh showing but it never calls the selector. I am not getting notified that the pull action happened.
I cannot use a UITableViewController as my main controller as I need to add a fixed button at the bottom of the screen.
I have the feeling I am missing something out that hopefully is obvious to someone else.
@interface ActivityViewController ()<UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate>
@end
- (void)viewDidLoad{
[super viewDidLoad];
_myTableView.delegate = self;
_myTableView.dataSource = self;
_tableViewController = [UITableViewController new];
_tableViewController.tableView = _myTableView;
[self addChildViewController:_tableViewController]; // Not sure this is necessary
_refreshControl = [UIRefreshControl new];
[_refreshControl addTarget:self action:@selector(loadMoreData) forControlEvents:UIControlEventValueChanged];
_tableViewController.refreshControl = _refreshControl;
}
- (void)loadMoreData{
NSLog(@"loadMoreData");
}