How many times have you done something like this:
The typo-prone string identifier, the forced cast… surely we can do better with Swift?
Let’s add a couple of useful extensions to UITableView
and its descendants:
This makes the assumption that the cell’s reuse identifier is identical to its class name.
Now, thanks to Swift’s type inference, all we need to do to get a cell of the correct type is: