Two Classes:
import UIKit struct ListSection { var rows : [ListRow]? var sectionTitle : String? } import UIKit struct ListRow { var someString: String? } Now when I try to append:
var row = ListRow() row.someString = "Hello" var sections = [ListSection]() sections[0].rows.append(row) // I get the following error: //Cannot invoke 'append' with an argument list of type (ListRow)' If I try this:
sections[0].rows?.append(row) // I get the following error: //Will never be executed How do I append to rows in section[0]?