Can any one please guide me ? Is it possible to open contact screen programmatically in iOS (swift)
How to open New Contact Screen Directly?
5.6k views Asked by Bucket At
4
There are 4 answers
1
On
Its possible to open this screen directly with some pre populated fields. No need of any workarounds.
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)
Try this below code. I think I am getting what you are looking for.