Replace hasLocalContacts with showLocalContacts.

Update the value of showLocalContacts in ContactsTableViewController.
This commit is contained in:
Doug
2021-08-09 12:58:18 +01:00
parent aa2f8d4d96
commit 0f87da3d53
3 changed files with 18 additions and 16 deletions
@@ -51,9 +51,10 @@ typedef enum : NSUInteger
}
/**
Whether or not the data source has any local contacts loaded.
Whether the data source should include local contacts in the table view.
Note: Updating this property does not automatically refresh the data source.
*/
- (BOOL)hasLocalContacts;
@property (nonatomic) BOOL showLocalContacts;
/**
Get the contact at the given index path.
@@ -467,7 +467,7 @@
}
// Keep visible the header for the both contact sections, even if they're are empty.
if (BuildSettings.allowLocalContactsAccess && [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusAuthorized)
if (BuildSettings.allowLocalContactsAccess && self.showLocalContacts && [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusAuthorized)
{
filteredLocalContactsSection = count++;
}
@@ -482,7 +482,7 @@
}
// Keep visible the local contact header, even if the section is empty.
if (BuildSettings.allowLocalContactsAccess && [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusAuthorized)
if (BuildSettings.allowLocalContactsAccess && self.showLocalContacts && [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusAuthorized)
{
filteredLocalContactsSection = count++;
}
@@ -660,11 +660,6 @@
#pragma mark -
- (BOOL)hasLocalContacts
{
return filteredLocalContacts.count;
}
-(MXKContact *)contactAtIndexPath:(NSIndexPath*)indexPath
{
NSInteger row = indexPath.row;