答案 0 :(得分:7)
那是很老的Swift。 map()
在早期的Swift版本中曾经是全局函数,但是(像其他filter
,index
等全局函数一样)已被instance method取代Swift 2中的Sequence
协议
let a = stride(from:0 , to: sections, by: 1).map {
stride(from:$0 , to: tempDataSource.count, by: sections).map {
tempDataSource[$0]
}
}
有关更多信息,请参见示例