From f126b58bbc1cac580954fa5d02b2d8bcf84946ed Mon Sep 17 00:00:00 2001 From: pawello2222 Date: Wed, 4 Nov 2020 09:43:31 +0100 Subject: [PATCH] Updated Contact --- Shared/Model/Contact.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Shared/Model/Contact.swift b/Shared/Model/Contact.swift index 461ba8f..2be7d1d 100644 --- a/Shared/Model/Contact.swift +++ b/Shared/Model/Contact.swift @@ -8,15 +8,12 @@ import Foundation -struct Contact: Hashable, Codable { +struct Contact: Identifiable, Hashable, Codable { + var id = UUID().uuidString var name: String var dateOfBirth: Date } -extension Contact: Identifiable { - var id: String { name } -} - extension Contact { static func getAll() -> [Contact] { let key = UserDefaults.Keys.contacts.rawValue