Instead of making a cell height = 0, you should be thinking about How to NOT show that cell.
If you can't duplicate your datasource without the dummy data (because is too big maybe?)
That's the easiest way by the way.
Then, you should build a function that can give you the correct data given an index.
For instance:
If you have [data1, dummy, data2, dummy, data3, data4]
If you ask for the second element of the datasource, it should respond data2
If you ask for the fourth element of the datasource, it should respond data4
Of course, you also needs a function that gives you the correct length
of the datasource without all your dummy data.
Then just use this functions in proper places (for instance):
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return numberOfActualDataItems(datasource)
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = //Obtain your reusable cell
let item = actualDataItemIndex(indexPath.row)
//configureCell will be the function were you place your data to view
self.configureCell(cell, item)
return cell
}