I'm trying to create a table inside a view. So that when the user is in view1 and pressing a button open a smaller view2 within view1 and choose one of the data from the table and when loading carries the selected data to view1.
I started by doing this in view1:
carViewSelect.frame = CGRectMake(10, 70, 355, 580)
carViewSelect.layer.borderColor = UIColor.blueColor().CGColor
carViewSelect.layer.borderWidth = borderSizeView
carViewSelect.layer.cornerRadius = 10
carViewSelect.backgroundColor = UIColor.whiteColor().colorWithAlphaComponent(0.9)
view.addSubview(carViewSelect)
listCars.frame = CGRectMake(10, 35, 340, 490)
listCars.registerClass(UITableViewCell.self, forCellReuseIdentifier: cellIdentifier)
listCars.numberOfRowsInSection(5)
var indexPath = NSIndexPath()
let cell : UITableViewCell = listCars.dequeueReusableCellWithIdentifier(cellIdentifier)! as UITableViewCell
cell.textLabel!.text = "hello WOrld"
cell.textLabel?.textColor = UIColor.blackColor()
listCars.indexPathForCell(cell)
listCars.backgroundColor = UIColor.grayColor()
carViewSelect.addSubview(listCars)
However the result I got was an empty table, as the picture shows:
The idea would be to put an image at the beginning of the cell, then a label and then another image. The data to fill the table see in an NSMutableArray