インポート次
import Contacts
import ContactsUI
がCNContactViewControllerDelegate
class ViewController: UIViewController, CNContactViewControllerDelegate
し、画面を提示した後、戻るボタンを追加する方法を次のコード
let newContact = CNMutableContact()
newContact.phoneNumbers.append(CNLabeledValue(label: "home", value: CNPhoneNumber(stringValue: "123456")))
let contactVC = CNContactViewController(forUnknownContact: newContact)
contactVC.contactStore = CNContactStore()
contactVC.delegate = self
contactVC.allowsActions = false
let navigationController = UINavigationController(rootViewController: contactVC) //For presenting the vc you have to make it navigation controller otherwise it will not work, if you already have navigatiation controllerjust push it you dont have to make it a navigation controller
self.present(navigationController, animated: true, completion: nil)
を追加し、私はポップ(画面を却下意味)。 self.dismiss(アニメーション:true、完了:なし) } – srivas
func contactViewController(_ viewController:CNContactViewController、完了:CNContact?) –