2
enumerateIndexesUsingBlockでValue of type 'IndexSet' has no member '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
}
}
代わりにブロックの何のための-で使用する場合は? >>> for(index、value)for self.enumerated() { print( "index = \(index)、value = \(value)") } – Che