I cannot find map in Swift. Anyone knows how to resolve this issue?
Use of unresolved identifier 'map'
I was trying to run this code
I cannot find map in Swift. Anyone knows how to resolve this issue?
Use of unresolved identifier 'map'
I was trying to run this code
That is quite old Swift. map()
used to be a global function in early Swift versions, but (like other global functions such as filter
, index
, ...) has been replaced by an instance method of the Sequence
protocol in Swift 2:
let a = stride(from:0 , to: sections, by: 1).map {
stride(from:$0 , to: tempDataSource.count, by: sections).map {
tempDataSource[$0]
}
}
For more information, see for example