nicklockwood, #Swift tip: if you need to bind a non-optional value to a temporary variable inside a conditional statement, you can use
case let
, e.g:if indexPath.section < sections.count,
case let section = sections[indexPath.section],
indexPath.row < section.rows.count,
case let row = section.rows[indexPath.row],
row.isEnabled
{
...
}This saves you needing to split up the condition into multiple statements, and polluting the local namespace with temporary variables you don't need again.
Add comment