【发布时间】:2017-01-13 23:06:51
【问题描述】:
我在尝试转换为 Swift 3 时尝试修复我的结局错误,但是我不确定为什么会收到错误
无法将 '() -> Void' 类型的值转换为预期的参数类型 '(() -> 无效)?'
对于
CATransaction.setCompletionBlock(completion)
功能齐全
fileprivate func deleteRowsAtIndexPaths(_ indexPaths: [IndexPath], withRowAnimation animation: UITableViewRowAnimation, duration: TimeInterval, completion:() -> Void) {
CATransaction.begin()
CATransaction.setCompletionBlock(completion) //Error
UIView.animate(withDuration: duration) { () -> Void in
self.deleteRows(at: indexPaths, with: animation)
}
CATransaction.commit()
}
有谁知道我为什么会得到这个以及如何解决这个错误?
【问题讨论】:
-
你确定消息说的是“cover”而不是“convert”吗?
-
@molbdnilo 哎呀,我的错,它确实说转换,必须拼写错误,然后拼写检查更正以覆盖。