我如何在CNContactViewController(forUnknownContact:)中获得图像?
我试过这样的方法:
fileprivate func showUnknownContactViewController() {
let aContact = CNMutableContact()
let newEmail = CNLabeledValue(label: CNLabelWork, value: email! as NSString)
aContact.emailAddresses.append(newEmail)
let workPhone = CNLabeledValue(label: CNLabelWork, value: CNPhoneNumber(stringValue : phone!))
aContact.phoneNumbers.append(workPhone)
aContact.imageData = UIImagePNGRepresentation(profilePicture.image!)
//Pushing controller...
}试图添加这样的图像:
aContact.imageData = UIImagePNGRepresentation(profilePicture.image!)
不幸的是,这是行不通的,我找不到任何其他的解决方案,因此我想问:有没有办法在CNContactViewController中显示图片?
我希望它是这样的:

发布于 2018-07-21 19:28:29
因此,在对matt进行了一些研究之后,我发现这个问题是由我展示的是一个现有的联系人引起的。
https://stackoverflow.com/questions/51459088
复制相似问题