CNContactViewController iOS 13放弃消息和键盘

在iOS 13上,我似乎无法使用CNContactViewController。这是我正在使用的代码:

 func showCNContactViewController(inVC vc: UIViewController,cncontact: CNContact,contact: Contact? = nil) {
        self.contact = contact
        self.mode = .editing

        let store = CNContactStore()
        let contactVC = CNContactViewController(forNewContact: cncontact)
        contactVC.delegate = self
        contactVC.allowsactions = false
        contactVC.contactStore = store
        contactVC.shouldShowLinkedContacts = true

        contactVC.title = cncontact.givenName
        let contactNC = UINavigationController(rootViewController: contactVC)
        vc.present(contactNC,animated: true,completion: nil)
    }

使用此方法我会收到一个奇怪的“放弃”消息,如果用户点击任何字段,它将显示键盘,并且该消息位于键盘下方,因此,用户甚至不使用“滑动”手势就无法退出该消息。 。我到处都在搜索,但确实找到了解决键盘问题的方法,但没有发现有人用丢弃消息报告此问题。

CNContactViewController iOS 13放弃消息和键盘

liuchongjun217 回答:CNContactViewController iOS 13放弃消息和键盘

您的项目缺少<PackageReference Include="AntiXSS" Version="4.3.0" />文件(它可以为空,但是应该存在于项目中)。

enter image description here

字符串将再次变得可读:)

enter image description here

本文链接:https://www.f2er.com/3056950.html

大家都在问