Create UITableViewCell in two types iOS swift

Solution:

1) In iOS you can create tableViewCell inside your tableView and assign a class.
Then in cellforRow you can use the cell using reusableIdentifier.

2) You can also create a cell in xib and insert a cell inside that and assign a class to that cell.Then in your ViewController Viewdidload method register that cell using the xib and cell identifier.Like below


        self.tableView.register(UINib(nibName: "Xibname", bundle: nil), forCellReuseIdentifier: "tableCell")


After that same as reuse the cell in the cellforRow delegate method.

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift