diff --git a/Signal/src/ViewControllers/NewContactThreadViewController.m b/Signal/src/ViewControllers/NewContactThreadViewController.m index f0e480581..a31a6ec6f 100644 --- a/Signal/src/ViewControllers/NewContactThreadViewController.m +++ b/Signal/src/ViewControllers/NewContactThreadViewController.m @@ -113,9 +113,25 @@ NS_ASSUME_NONNULL_BEGIN [self.noSignalContactsView autoPinEdgeToSuperviewEdge:ALEdgeTop]; [self.noSignalContactsView autoPinToBottomLayoutGuideOfViewController:self withInset:0]; + UIRefreshControl *pullToRefreshView = [UIRefreshControl new]; + pullToRefreshView.tintColor = [UIColor grayColor]; + [pullToRefreshView addTarget:self + action:@selector(pullToRefreshPerformed:) + forControlEvents:UIControlEventValueChanged]; + [self.tableViewController.tableView insertSubview:pullToRefreshView atIndex:0]; + [self updateTableContents]; } +- (void)pullToRefreshPerformed:(UIRefreshControl *)refreshControl +{ + OWSAssert([NSThread isMainThread]); + + [self.contactsViewHelper.contactsManager requestSystemContactsOnce]; + + [refreshControl endRefreshing]; +} + - (void)showContactsPermissionReminder:(BOOL)isVisible { _hideContactsPermissionReminderViewConstraint.active = !isVisible; @@ -789,6 +805,18 @@ NS_ASSUME_NONNULL_BEGIN } } +#pragma mark - Logging + ++ (NSString *)tag +{ + return [NSString stringWithFormat:@"[%@]", self.class]; +} + +- (NSString *)tag +{ + return self.class.tag; +} + @end NS_ASSUME_NONNULL_END