Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nkalvi patch 1 #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Demo/Views/ContactView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct ContactView: View {
@State private var error: Error?

// We just pass along the identifier and then lets the property wrapper handle the fetch and observation
init(identifier: CNContact.ID) {
init(identifier: String) {
_contact = FetchContact(
idenfifier: identifier,
keysToFetch: .allExcludingNote
Expand Down
10 changes: 8 additions & 2 deletions Sources/Connections/Support/Identifiable.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import Foundation
import Contacts

extension CNContact {
public var id: String { identifier }
@available(iOS, obsoleted: 16, message: "Contacts module includes it in iOS17+, macOS14+")
@available(macOS, obsoleted: 14, message: "Contacts module includes it in iOS17+, macOS14+")
extension CNContact: Identifiable {
public typealias ID = UUID
public var id: UUID {
UUID(uuidString: identifier.replacingOccurrences(of: ":ABPerson", with: ""))!
}

}

extension CNGroup: Identifiable {
Expand Down