Ris*_*hab 10
请尝试以下代码.我想我正在寻找你想要的东西.
let con = CNContact()
let vc = CNContactViewController(forNewContact: con)
_ = self.navigationController?.pushViewController(vc, animated: true)
Run Code Online (Sandbox Code Playgroud)
可以通过一些预填充字段直接打开此屏幕。不需要任何解决方法。
let contact = CNMutableContact()
let homePhone = CNLabeledValue(label: CNLabelHome, value: CNPhoneNumber(stringValue :"number goes here"))
contact.phoneNumbers = [homePhone]
contact.imageData = data // Set image data here
let vc = CNContactViewController(forNewContact: contact)
vc.delegate = self
let nav = UINavigationController(rootViewController: vc)
self.present(nav, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2152 次 |
| 最近记录: |