Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CNUI ERROR Contact view delayed appearance timed out

Tags:

ios

ios10

I am trying to show the Contacts add new contact view with the ContactsUI framework in iOS 10. The code that I am using to present CNContactViewController the is the following:

    let contactViewController = CNContactViewController(forNewContact: contact)
    contactViewController.contactStore = CNContactStore()
    contactViewController.delegate = self

    self.present(contactViewController, animated: false) {}

But every time I execute the code the app gets frozen and I get three + times the following error log: [CNUI ERROR] Contact view delayed appearance timed out

Any explanation is welcome,

like image 768
rockdaswift Avatar asked Aug 03 '16 16:08

rockdaswift


1 Answers

I find a workaround. Just wrap your CNContactViewController in UINavigationController and all will be fine.

Special code sample for @JackRobson

let contactViewController = CNContactViewController(forNewContact: contact)
contactViewController.contactStore = CNContactStore()
contactViewController.delegate = self
let navigationController = UINavigationController(rootViewController: contactViewController)
self.present(navigationController, animated: false) {}
like image 160
Andrew Vyazovoy Avatar answered Oct 15 '22 20:10

Andrew Vyazovoy