我正在创建一个新应用程序,我想放入一个隐藏文件夹中。可通过 Face ID/Touch ID 访问。我已经实现了代码,但是当我运行该应用程序并使用 Face ID 时。该应用程序因错误“NSInternalInconsistencyException”而崩溃
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.
Run Code Online (Sandbox Code Playgroud)
在我的 Viewcontroller 中,我将视图设置为:
override func viewDidLoad() {
super.viewDidLoad()
let cornerRadius : CGFloat = 10.0
containerView.layer.cornerRadius = cornerRadius
tableView.clipsToBounds = true
tableView.layer.cornerRadius = 10.0
// 1
let context = LAContext()
var error: NSError?
// 2
// check if Touch ID is available
if …Run Code Online (Sandbox Code Playgroud)