2
接收Value of type 'IndexSet' has no member 'enumerateIndexesUsingBlock'
enumerateIndexesUsingBlock錯誤。Swift 3.0:類型'IndexSet'的值沒有成員'enumerateIndexesUsingBlock'
/**
Extension for creating index paths from an index set
*/
extension IndexSet {
/**
- parameter section: The section for the created NSIndexPaths
- return: An array with NSIndexPaths
*/
func bs_indexPathsForSection(_ section: Int) -> [IndexPath] {
var indexPaths: [IndexPath] = []
self.enumerateIndexesUsingBlock { (index:Int, _) in
indexPaths.append(IndexPath(item: index, section: section));
}
return indexPaths
}
}
如果使用換的,而不是塊? (index,\ index),value = \(value)「) }對於(index,value)in self.enumerated() { } – Che