0

I have structure like this

storyboard → myScene → myView → TableView

this is bind in my ViewController's class like this

@IBOutlet weak var tableView: UITableView!

I also have a cell file (xib) for my ShopHistoryCell. This is added to Viewcontroller's TableView like this

self.tableView.delegate = self
self.tableView.dataSource = self
self.tableView.register(UINib(nibName: "ShopHistoryCell", bundle: nil), forCellReuseIdentifier: "ShopHistoryCell")

and called like this from TableView function

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "ShopHistoryCell", for: indexPath) as! ShopHistoryCell
cell.delegate = self
...

My cell file is just a boilerplate like this

class ShopHistoryCell: UITableViewCell {
...

Problem is that cell is fullscreen wide with no merging, no padding, no spaces between cells. I tried this approaches but these work for normal cell inside of tableview. Not working in my case

*my .xib file is just a Table View cell with Content View inside

file

Marcel Kopera
  • 179
  • 11
  • Did you add any padding in the cell's xib file? If not, why did you expect it to have padding? Please show a [mcve]. – Sweeper Jun 28 '23 at 06:58
  • I added how the xib file looks like, It only contains the cell. Could you please explain how to add padding to the cell when not parent is present? When I add normal View inside the cell this is making bad side effect when pressing the cell – Marcel Kopera Jun 28 '23 at 07:03

0 Answers0