I'm creating an iOS and macCatalyst app with drag and drop contacts vCard, it's working fine in the iPad "Drag contact vCard from my app and able to drop in default Contact and other apps", In macCatalyst can't able drop vCard item to the default Contacts app
NSItemProviderWriting
final class ContactItem: NSObject, NSItemProviderWriting {
var data: Data
private static let CONTACT_V_CARD = "public.vcard"
static var writableTypeIdentifiersForItemProvider: [String] = [
CONTACT_V_CARD
]
init(_ name: String) throws {
let cnContact = CNMutableContact()
cnContact.givenName = name
let data = try CNContactVCardSerialization.data(with: [cnContact])
self.data = data
}
func loadData(withTypeIdentifier typeIdentifier: String, forItemProviderCompletionHandler completionHandler: @escaping (Data?, Error?) -> Void) -> Progress? {
let progress = Progress(totalUnitCount: 100)
progress.completedUnitCount = 100
completionHandler(data, nil)
return progress
}
}