-2

I just try to call function with below code

func bugVersionPressed() {

    let contact = CNMutableContact()
    contact.familyName = "aaaa"
    contact.givenName = "aaaa"
    contact.organizationName = "bbbb"
    let addContactVC = CNContactViewController(forNewContact: contact)

    let navController = UINavigationController(rootViewController: addContactVC)
    navController.view.backgroundColor = .red
    navController.modalPresentationStyle = .fullScreen
    self.present(navController, animated: true, completion: nil)
}

But the apple seems havent handle keyboard dismiss problem, I CAN'T DISMISS THE KEYBOARD AND I CAN'T GO BACK TO THE HOME PAGE BY PRESS "Cancel"

PIC1 : (Before present to CNContactViewController) Before present to CNContactViewController

PIC2 : (Bug Case, Keyboard Cannot dismiss) Bug Case, Keyboard Cannot dismiss

PIC3 : (Wish Case, Keyboard Dismiss while Clicked "Cancel") Wish Case, Keyboard Dismiss while Clicked "Cancel"

In case I found a AppleStore App https://apps.apple.com/cn/app/%E5%BE%AE%E5%95%86%E5%8A%A0%E7%B2%89%E5%AE%9D-%E5%85%8D%E6%B3%A8%E5%86%8C%E6%B7%BB%E5%8A%A0%E6%B4%BB%E7%B2%89-%E8%81%94%E7%B3%BB%E4%BA%BA%E5%A5%BD%E5%8F%8B%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90/id475661774 but same problem. Please tell me what can I do. Many thanks.

Alvis
  • 3
  • 2
  • Why are you presenting your modal in `.fullscreen` - If you simply adopt the new modal presentation style in iOS 13 then the user can simply swipe the view controller away. – Paulw11 Sep 26 '19 at 09:06
  • Also, all three of those screen shots look identical – Paulw11 Sep 26 '19 at 09:17
  • @Paulw11 swipe can dismiss i know, but the user will confuse the "cancel" button use for... – Alvis Sep 26 '19 at 09:40
  • What happens after you click "Discard changes" in screen shot 3? – Paulw11 Sep 26 '19 at 09:45
  • Please don't use URL shorteners for links on Stack Exchange. The *only* valid reason to use them on Stack Exchange would be if you needed to save characters, but you *don't* need to save characters in questions or answers here. Using a URL shortener makes the link, and your post, look like spam or otherwise nefarious (e.g. that the link may go to a spam site, infected download, or a site that contains viruses/trojans, used for tracking clicks, earning money per click, etc.) – Makyen Sep 27 '19 at 00:23
  • So what is that weird keyboard? – matt Sep 27 '19 at 00:59
  • @Paulw11 If I pressed "Discard changes" the dismiss view function will works, but this is my expect case and it never dismiss my keyboard (even orginal english keyboard) when i click blank place or "Cancel button" on top left. May be you can download app "https://apps.apple.com/cn/app/%E5%BE%AE%E5%95%86%E5%8A%A0%E7%B2%89%E5%AE%9D-%E5%85%8D%E6%B3%A8%E5%86%8C%E6%B7%BB%E5%8A%A0%E6%B4%BB%E7%B2%89-%E8%81%94%E7%B3%BB%E4%BA%BA%E5%A5%BD%E5%8F%8B%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90/id475661774" and try to type somthing and leave, then you will know what i say :( Thanks again – Alvis Sep 27 '19 at 01:36
  • @matt errrr.. I forgot change that to default keyboard from custom keyboard, but the bug is not come from this keyboard – Alvis Sep 27 '19 at 01:46
  • I don't see why not. If you use the normal keyboard, it has a Return key and you can dismiss the keyboard. – matt Sep 27 '19 at 01:52
  • @matt return key in this page is using for next TextField ... its not a dismiss keyboard button... – Alvis Sep 27 '19 at 09:29

1 Answers1

1

The problem doesn't occur in iOS 13, but in iOS 13.1. I think this is a problem with the CNContactViewController, not CNMutableContact.

I'm sorry, but I don't know how to avoid it because of Apple's framework. Send a bug report to Apple.

tom
  • 26
  • 3