KNContactsPicker remove empty phone numbers while picking contact swift
Problem:
I had used KNContactsPicker for adding contacts in my app.But it fetches empty phone numbers also .How to avoid fetching empty contacts swift?
Solution:
KNcontact picker had settings.You can also select multiple contacts.You can use the condition as below that
"!contact.phoneNumbers.isEmpty".For fetching the contacts.
Code:
import KNContactsPicker
var settings = KNPickerSettings()
settings.selectionMode = .multiple
settings.subtitleDisplayInfo = .phoneNumber
settings.conditionToDisplayCon
return !contact.phoneNumbers.isEmpty
}
let controller = KNContactsPicker(delegate: self, settings: self.settings)
self.navigationController?.pre
Comments
Post a Comment