无法将类型'(_( -> Void?'的值转换为预期的参数类型'((( -> Void(?
[!在此处输入图像描述][1]][1]
[1]: https://i.stack.imgur.com/M1MYV.png'func deselectSelectedCells(( { 如果让开始 = 开始日期索引路径 { var section = start.section var 项 = 开始项 + 1
if let cell = collectionView?.cellForItem(at: start) as? AirbnbDatePickerCell {
cell.type.remove([.InBetweenDate, .SelectedStartDate, .SelectedEndDate, .Selected])
cell.configureCell()
collectionView?.deselectItem(at: start, animated: false)
}
if let end = endDateIndexPath {
var indexPathArr = [IndexPath]()
while section < months.count, section <= end.section {
let curIndexPath = IndexPath(item: item, section: section)
if let cell = collectionView?.cellForItem(at: curIndexPath) as? AirbnbDatePickerCell {
cell.type.remove([.InBetweenDate, .SelectedStartDate, .SelectedEndDate, .Selected])
cell.configureCell()
collectionView?.deselectItem(at: curIndexPath, animated: false)
}
if section == end.section && item >= end.item {
// stop iterating beyond end date
break
} else if item >= (collectionView!.numberOfItems(inSection: section) - 1) {
// more than num of days in the month
section += 1
item = 0
} else {
item += 1
}
}
collectionView?.performBatchUpdates({
(s) in
self.collectionView?.reloadItems(at: indexPathArr)
}, completion: nil)
}
}
}`
该错误会告诉您解决方案。 performBatchUpdates
在没有参数的情况下进行回调,但您在那里定义了一个参数。
删除声明回调参数的 performBatchUpdates
下带有 (s) in
的行(第 40 行(。