{"id":24756387,"url":"https://github.com/dragosrobertn/kncontactspicker","last_synced_at":"2025-07-14T09:04:11.127Z","repository":{"id":50095593,"uuid":"218032181","full_name":"dragosrobertn/KNContactsPicker","owner":"dragosrobertn","description":"A modern, highly customisable contact picker with search and multi-selection options.","archived":false,"fork":false,"pushed_at":"2024-08-19T19:03:25.000Z","size":2908,"stargazers_count":20,"open_issues_count":4,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-03T09:09:55.899Z","etag":null,"topics":["contact-picker","contacts","dark-theme","ios","ios13","swift","uikit"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dragosrobertn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-28T11:34:03.000Z","updated_at":"2024-11-03T22:06:49.000Z","dependencies_parsed_at":"2022-08-03T19:00:26.947Z","dependency_job_id":null,"html_url":"https://github.com/dragosrobertn/KNContactsPicker","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragosrobertn%2FKNContactsPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragosrobertn%2FKNContactsPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragosrobertn%2FKNContactsPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragosrobertn%2FKNContactsPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dragosrobertn","download_url":"https://codeload.github.com/dragosrobertn/KNContactsPicker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236026942,"owners_count":19083396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contact-picker","contacts","dark-theme","ios","ios13","swift","uikit"],"created_at":"2025-01-28T13:53:28.106Z","updated_at":"2025-01-28T13:53:28.761Z","avatar_url":"https://github.com/dragosrobertn.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KNContactsPicker\n![CocoaPods](https://img.shields.io/cocoapods/v/KNContactsPicker) [![codebeat badge](https://codebeat.co/badges/aaf07a97-7f1b-4c91-9966-2dcbbfb34ae5)](https://codebeat.co/projects/github-com-dragosrobertn-kncontactspicker-master) ![contributions](https://img.shields.io/badge/contributions-welcome-informational.svg)\n\nA modern, highly customisable contact picker with multi-selection options that closely resembles the behaviour of the ContactsUI's CNContactPickerViewController.\n\n# Preview\n|![Single Deselect Mode](https://github.com/dragosrobertn/KNContactsPicker/blob/main/PreviewGIFs/SingleDeselectMode.gif)|![Single Reselect Mode](https://github.com/dragosrobertn/KNContactsPicker/blob/main/PreviewGIFs/SingleReselectMode.gif)|![Multiple Select Mode](https://github.com/dragosrobertn/KNContactsPicker/blob/main/PreviewGIFs/MultiSelectionMode.gif)|\n|---|---|---|\n|Single Deselect|Single Reselect|Multi Select|\n\n# Installation\n\n## CocoaPods\nAdd this to your podfile for the latest version\n```\npod 'KNContactsPicker'\n```\nOr specify desired version\n```\npod 'KNContactsPicker', '~\u003e 0.3'\n```\n\n\n## Manual Installation\nDownload and include the `KNContactsPicker` folder and files in your codebase.\n\n## Requirements\n - iOS 12+\n - Swift 5\n \n# Features\nKNContactsPicker is a modern, customisable and easy to use Contacts Picker similar to the stock CNContactPickerViewController. It does improve in a couple of area for a better UX.\n\n- Three contact selection modes:\n  - Single Deselect (Deselects all other contacts after first contact is selected)\n  - Single Reselect (Selects another contact on tap)\n  - Multi Select\n- Contact images or initials\n- Search contacts and ability to select while searching\n- Clear selection button\n- Contact section indexes to quickly navigate through the contact list\n- Returns CNContact objects\n- Highly customisable settings for strings and options\n- Two conditional methods to enable or deselect certain contacts\n- Support iOS 13 \n  - Dark Mode\n  - Icons (SF Symbols)\n  - Pull to Dismiss\n\nComing soon:\n- Extra contact info under name\n- Contact sort order\n- Contact display order\n- More modular contact property approach\n\nMake sure your app (the host app) has provided a `Privacy - Contacts Usage Description` in your `Info.plist`. \nIt's also recommended that you check that contact authorisation is granted. \n\n## How to use\nImplement the Delegate Methods\n```swift\n// This is in your application\nextension ViewController: KNContactPickingDelegate {\n    func contactPicker(didFailPicking error: Error) {\n        print(error)\n    }\n    func contactPicker(didCancel error: Error) {\n         print(error)\n    }\n    func contactPicker(didSelect contact: CNContact) {\n        self.contacts.append(contact)\n        self.contactsTableView.reloadData()\n    }\n    \n    func contactPicker(didSelect contacts: [CNContact]) {\n        self.contacts.append(contentsOf: contacts)\n        self.contactsTableView.reloadData()\n    }\n}\n```\n\nCustomise the Settings\n```swift\nvar settings = KNPickerSettings()\nsettings.pickerTitle = \"Pick\"\n\nsettings.conditionToDisplayContact = { contact in\n  return contact.organizationName == \"Apple\"\n}\nsettings.conditionToDisableContact = { contact in\n    return self.contacts.contains(contact)\n}\n```\nInitialise and Present the KNContactsPicker\n```swift\nlet controller = KNContactsPicker(delegate: self, settings: settings)\n        \nself.navigationController?.present(controller, animated: true, completion: nil)\n```\n\n## Recommended\nYou can use KNContactsPicker with [KNContacts](https://github.com/dragosrobertn/KNContacts) framework.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragosrobertn%2Fkncontactspicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdragosrobertn%2Fkncontactspicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragosrobertn%2Fkncontactspicker/lists"}