以下代码片段是从在线教程中检索到的:
typealias TableCellConfigurationBlock = (cell: ScheduleTableViewCell, indexPath: NSIndexPath, session: Session) -> ()
'typealias' 似乎是一个闭包;还是产生 void() 的元组?
但我不知道它在以下函数中是如何工作的:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("ScheduleTableViewCell") as! ScheduleTableViewCell
let session = sessionForIndexPath(indexPath)
if let configureBlock = tableCellConfigurationBlock {
configureBlock(cell: cell, indexPath: indexPath, session: session)
}
return cell
}
解释?
参考?