CNContactViewController forUnknownContact unusable, destroys interface

I’ve hidden the UINavigationController method for show or hide the navigation bar by using categories: @interface UINavigationController (contacts) @end @implementation UINavigationController (contacts) – (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated { NSLog(@”Hide: %d”, hidden); } @end This way the CNContactViewController cannot make the navigation bar to disappear. Setting a breakpoint on NSLog I discovered that this method is called by … Read more

Fetching all contacts in ios Swift?

Swift 4 and 5. I have create class PhoneContacts. Please add NSContactsUsageDescription key to your info.plist file import Foundation import ContactsUI class PhoneContacts { class func getContacts(filter: ContactsFilter = .none) -> [CNContact] { // ContactsFilter is Enum find it below let contactStore = CNContactStore() let keysToFetch = [ CNContactFormatter.descriptorForRequiredKeys(for: .fullName), CNContactPhoneNumbersKey, CNContactEmailAddressesKey, CNContactThumbnailImageDataKey] as [Any] … Read more