Where does UICollectionView.CellRegistration get its arguments from?

Viewed 27

I'm trying to learn UIKit for iOS development and already hit a roadblock in my understanding. In the Apple tutorial on their website they use a UICollectionView.CellRegistration to configure the way a list is displayed, that I understand but the code seems to magically acquire the data type that I set up in another file without me ever explicitly giving it to it. This is the sample they gave on the Apple developer site, but not really an explanation of how it works.

let cellRegistration = UICollectionView.CellRegistration { (cell: UICollectionViewListCell, indexPath: IndexPath, _: String) in
    let reminder = Reminder.sampleData[indexPath.item]
    var contentConfiguration = cell.defaultContentConfiguration()
    contentConfiguration.text = reminder.title
    cell.contentConfiguration = contentConfiguration
}

It works and everything, but I'm very confused on where the "cell", "indexPath", and the last String argument come from.

1 Answers
Related