I'm trying to fill the information of a CNMutableContact to save it and share it, and everything works perfectly except the note (that should be a regular String) and the imageData.
This is what i'm trying to do:
let contact = CNMutableContact()
contact.note = "HELLO"
if let imageUrl = self.getImgLogo(), let url = URL(string: imageUrl) {
contact.imageData = try? Data(contentsOf: url)
}
I set more things into the contact like the givenName, familyName, jobTitle, socialProfiles, phoneNumbers, emails, ... and everything works ok but those two things.
Anyone can tell me if am i doing something wrong?
Thanks!