How to create an iOS share extension for contacts
问题 I am trying to create an iOS share extension to share contacts using the following code: let contactType = "public.vcard" override func viewDidLoad() { let items = extensionContext?.inputItems var itemProvider: NSItemProvider? if items != nil && items!.isEmpty == false { let item = items![0] as! NSExtensionItem if let attachments = item.attachments { if !attachments.isEmpty { itemProvider = attachments[0] as? NSItemProvider } } } if itemProvider?.hasItemConformingToTypeIdentifier(contactType)