1

我如何在里面获得图像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

这就是我想要的样子: 史莱克图片

4

1 回答 1

2

因此,在对matt进行了一些研究后,我发现问题是由于我显示的联系人是现有联系人而引起的。

于 2018-07-21T19:28:29.230 回答