我有我的项目中下面的代码,应用中的“画外音”崩溃时UIContextualAction有一个空的标题 - iOS的11
@available(iOS 11.0, *)
func tableView(_ tableView: UITableView,
trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let emailAction = UIContextualAction(style: .normal,
title: "",
handler: { (_, _, success: (Bool) -> Void) in
// Some code
success(true)
})
emailAction.image = #imageLiteral(resourceName: "envelope")
let deleteAction = UIContextualAction(style: .normal,
title: "",
handler: { (_, _, success: (Bool) -> Void) in
// Some code
success(true)
})
deleteAction.image = #imageLiteral(resourceName: "trash")
return UISwipeActionsConfiguration(actions: [emailAction, deleteAction])
}
,当我打开语音崩溃。下面查找错误,我得到,
***断言失败 - [UITableTextAccessibilityElement _accessibilityCustomActionNamesAndIdentifiers],/BuildRoot/Library/Caches/com.apple.xbs/Sources/AccessibilityFrameworks/AccessibilityFrameworks-2396.1.4/Source/UIAccessibility /NSObjectAccessibility.m:3249
***终止应用程序由于未捕获的异常“NSInternalInconsistencyException”,理由是:“UIAccessibilityCustomAction必须有一个名字。”