I have a basic uitableview with 2 UITableViewCell I am trying to fill the first cell with array1.count and the second cell with array2.count but I don't know how, this is my code:
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
var value: Int = 0
if(section == 0){
value = 1
}else if(section == 2){
value = 5
}
return value
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: Storyboard.cell1, for: indexPath) as! Cell1
cell.lbl_cell1.text = "Subject"
cell.selectionStyle = .none
return cell
} else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: Storyboard.cell2, for: indexPath) as! Cell2
cell.lbl_cell2.text = "Lorem Ipsum es simplemente el texto de relleno de las imprentas y archivos de texto. Lorem Ipsum ha sido el texto de relleno estándar de las industrias desde el año 1500, cuando un impresor (N. del T. persona que se dedica a la imprenta) desconocido usó una galería de textos y los mezcló de tal manera que logró hacer un libro de textos especimen."
cell.selectionStyle = .none
return cell
}
return UITableViewCell()
}
My error is that I always get 1 value in each cell, All I want is this
Cell 1 Math cell 2 a,b,c,d,e,f,g,h .....
Thanks in advance