func tableView()

in eCommerce/Controllers/ProductsViewController.swift [175:188]


    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        guard let cell = tableView.dequeueReusableCell(withIdentifier: "ProductCell") else {
            return UITableViewCell()
        }

        if let productView = Bundle.main.loadNibNamed("ProductView", owner: self, options: nil)?[0] as? ProductView {
            productView.setup(with: products[indexPath.row], in: cell.bounds)
            productView.showBottomSeparator(indexPath.row != products.count - 1)
            cell.addSubview(productView)
            cell.layoutSubviews()
        }

        return cell
    }