Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edonv/swiftuicontacts
SwiftUI wrapper of CNContactPickerViewController.
https://github.com/edonv/swiftuicontacts
cncontactpickerviewcontroller contactsui ios macos swiftui
Last synced: 4 months ago
JSON representation
SwiftUI wrapper of CNContactPickerViewController.
- Host: GitHub
- URL: https://github.com/edonv/swiftuicontacts
- Owner: edonv
- License: mit
- Created: 2023-03-01T22:21:05.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-22T18:30:41.000Z (11 months ago)
- Last Synced: 2024-10-12T18:03:01.405Z (4 months ago)
- Topics: cncontactpickerviewcontroller, contactsui, ios, macos, swiftui
- Language: Swift
- Homepage:
- Size: 34.2 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# SwiftUIContacts
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fedonv%2FSwiftUIContacts%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/edonv/SwiftUIContacts)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fedonv%2FSwiftUIContacts%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/edonv/SwiftUIContacts)`SwiftUI` wrapper of [`ContactsUI`](https://developer.apple.com/documentation/contactsui)'s [`CNContactPickerViewController`](https://developer.apple.com/documentation/contactsui/cncontactpickerviewcontroller). Eventually, I'll add the rest of the framework.
## To-Do's
- [ ] Port over macOS-exclusive ViewControllers (`CNContactViewController`'s usage on macOS, and `CNContactPicker`).## Documentation
Documentation for `SwiftUIContacts` is hosted on [Swift Package Index](https://swiftpackageindex.com/edonv/SwiftUIContacts/documentation/swiftuicontacts).
## ContactPicker
`ContactPicker` supports four different selection modes and the mode is decided by which `init` you use:
- A single contact
- Use a `@Binding` of type `CNContact?` in the `init`
- Multiple contacts
- Use a `@Binding` of type `[CNContact]` in the `init`
- A single property of a contact
- Use a `@Binding` of type `CNContactProperty?` in the `init`
- A single property from multiple contacts
- Use a `@Binding` of type `[CNContactProperty]` in the `init````swift
.sheet(isPresented: $showSheet) {
ContactPicker(selection: $selectedProperty,
displayedPropertyKeys: [.phoneNumbersKey]
)
}
```