I'm trying to create a simple table, and in a cell the content should be the view of a UIViewController, which has another UITableView.
But the cell goes blank, I tried several different ways. But I did not find a solution.
Below my last test code that served to ensure that a view is delivered to the cell, however it is shown in white. Without the UITableView.
if indexPath.section == 5 {
let cell = tableView.dequeueReusableCellWithIdentifier("CellLimpa", forIndexPath: indexPath) as! UITableViewCell
let stBoard = UIStoryboard(name: "Main", bundle: nil)
let lsCarrosVC = stBoard.instantiateViewControllerWithIdentifier("listaDeCarrosComplexa") as! ListaDeCarrosComplexaViewController
cell.backgroundColor = UIColor.blueColor()
lsCarrosVC.view.frame = CGRect(x: 0, y: 0, width: 300, height: 300)
lsCarrosVC.view.backgroundColor = UIColor.greenColor()
lsCarrosVC.tabelaCarros.frame = CGRect(x: 0, y: 0, width: 300, height: 300)
cell.conteudoView.backgroundColor = UIColor.blueColor()
cell.conteudoView.addSubview(lsCarrosVC.view)
return cell
}
Result:
The green area is the ListaDeCarrosComplexaViewController
view. And the blue area is the bottom of the cell.