Вы можете использовать только одну структуру и установить многомерный массив, где один массив будет состоять из изображений от 1 до 7, а другой от 8 до 15. В файле, где вы добавляете контент в свою ячейку, вы можете создать:
let data: [[imageOneSection]] = [[imageOneSection.init(titleImageOneSec: imageName), numImage), ...],
[imageOneSection.init(titleImageOneSec: imageName, numImage), ...]]
Тогда для ваших методов табличного представления добавьте:
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return data.count
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return data[section].count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
// init your cell
cell.addContent (data[indexPath.section][indexPath.row])
}
В свой класс ячейки добавьте:
func addContent (data: imageOneSection) {
yourTextLabel.text = data.titleImageOneSec + "\(data. numImageOneSec)"
yourImageView.image = UIImage.init(named: data.titleImageOneSec)
}
Надеюсь, это поможет вам.