This code was working fine in Monterey but since upgrading to Ventura it no longer works:
let contactsUTTypes = [UTType.vCard, UTType.contact]
func performDrop(info: DropInfo) -> Bool
{
print (info)
let items = info.itemProviders(for: contactsUTTypes)
print (items)
for item in items
{
item.loadDataRepresentation(forTypeIdentifier: UTType.vCard.identifier, completionHandler: { (data, error) in
if let data = data,
let contact = try? CNContactVCardSerialization.contacts(with: data).first
{
print("Contact: \(contact.givenName)")
}
})
}
return true
}
let items = info.itemProviders(for: uttypes)
always returns zero items
Has this been broken in Ventura or do I need to do this differently now?
Post
Replies
Boosts
Views
Activity
I have been waiting for this for many years. Thank you. Is there demo code that accompanies this video?