How do I use Swift in iOS to take a Group of Contacts and copy it all to another iOS device using a different Apple ID

How do I use Swift in iOS to take a Group of Contacts and copy it all to another iOS device using a different Apple ID?

I have looked into fetching the Contacts using CNContactStore, using the Share App Extension, and somehow using .vcf files.

I'm looking for any ideas anyone has. Hopefully I can pick the simplest way to do this from someone's idea.