Currently I am placing a UITableView inside my UIViewController, with multiple other items. I am not using a UITableViewController.
However I am unable to register the identifier "masterlist", or should I say I am not sure where I can register it. I am not using storyboard, and if I am still to register it in my UIViewController's viewDidLoad, I am unable to figure out the proper syntax.
Is this something I can do?
class BeginNewCustomer: UIViewController {
let myList = createTblView()
override func viewDidLoad() {
super.viewDidLoad()
myList.delegate = self
myList.dataSource = self
}
func createTblView() -> UITableView {
let myTable = MyTableView(frame: CGRect(x: 0, y: 0, width: 0, height: 0 ))
myTable.backgroundColor = .white
return myTable
}
extension BeginNewInv: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dbClass.invsList.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell()
// let cell = tableView.dequeueReusableCell(withIdentifier: "masterlist", for: indexPath)
var config = cell.defaultContentConfiguration()
.... fill the configuration
cell.contentConfiguration = config
return cell
}
}