我如何在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
内显示图片?