ios - CNContactViewController 弹出前出现意外图标
问题描述
我正在尝试使用 Swift 为 NewContact 创建一个 CNContactView。单击按钮后,应该会弹出一个 CNContactViewController,但在视图弹出之前会出现一些奇怪的徽标。如何解决这个问题?
我正在使用 Swift 4.1,但在我的旧项目 Swift 3.3 上也遇到了同样的问题。Xcode 版本是 9.4.1。
这是视频演示:Bug的视频演示
这是项目:项目
import UIKit
import Contacts
import ContactsUI
class ViewController: UIViewController,CNContactViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
func contactViewController(_ vc: CNContactViewController, didCompleteWith con: CNContact?) {
vc.dismiss(animated: true)
}
@IBAction func addContact(_ sender: Any) {
let con = CNMutableContact()
con.givenName = "test"
let unkvc = CNContactViewController(forNewContact: con)
unkvc.delegate = self as CNContactViewControllerDelegate
self.present(UINavigationController(rootViewController: unkvc), animated:true)
self.view.endEditing(true)
}
}
2018-06-19 15:52:13.911766-0700 contactbook[5319:1973728] Access to PassKit Shared Cache file denied. Please verify sandbox exceptions and/or file a Radar.
2018-06-19 15:52:14.087053-0700 contactbook[5319:1973728] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
2018-06-19 15:52:14.269548-0700 contactbook[5319:1973728] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2018-06-19 15:52:14.270754-0700 contactbook[5319:1973728] [MC] Reading from public effective user settings.
2018-06-19 15:52:14.342483-0700 contactbook[5319:1973728] [Snapshotting] Snapshotting a view (0x10334a5a0, _UIButtonBarStackView) that has not been rendered at least once requires afterScreenUpdates:YES.
2018-06-19 15:52:14.342971-0700 contactbook[5319:1973728] [Snapshotting] Snapshotting a view (0x10334ab00, _UIButtonBarStackView) that has not been rendered at least once requires afterScreenUpdates:YES.
解决方案
推荐阅读
- cryptography - 在 NTRUEncrypt 中计算逆多项式的算法
- excel-formula - 我想复制一个以数字结尾的公式,但将新公式中的数字修改为固定值
- python - 使用 Colab 时出现 KeyError
- node.js - Node.JS OvernightJS Express CORS XMLHttpRequest 已被 CORS 策略阻止
- docker - 如何在 docker swarm 服务中重新加载环境文件?
- python - 不可变内部的可变对象具有不同的行为
- c++ - 带有 SFINAE 的 static_assert
- ios - “设置:CFBundleVersion $buildNumber”未在 XCode 12 中设置递增的内部版本号
- swift - 填充 HStack swiftUI
- .net-core - SolrNet - 如何将查询字符串添加到 url