I'm trying to fetch Me contact (if it's defined) from CNContact store.
The only mention I found about doing this is through unifiedMeContactWithKeys(toFetch:).
But when I try to use it, both in Xcode Version 8.1 (8B62) and Version 8.2 beta (8C23), and error shows indicating it's unavailable.
Xcode's documentation mentions the method, but has no further documentation whatsoever.
The lines of code used is:
do {
let meContact = try store.unifiedMeContactWithKeys(toFetch: keysToFetch as! [CNKeyDescriptor])
self.me = Persona(nombre: "\(meContact.givenName)\(meContact.middleName != "" ? " " + meContact.middleName : "")",
apellido: "\(meContact.familyName)",
fechaDeNacimiento: formatter.date(from: "\(meContact.birthday!.day!) \(meContact.birthday!.month!) \(meContact.birthday!.year!)")! ,
direccion: 8537)
}
catch {
self.me = Persona(nombre: "John", apellido: "Doe", fechaDeNacimiento: formatter.date(from: "01 12 1962")!, direccion: 8537)
}