I already read and saw some videos about this subject but i can\'t get this to work. Im trying to a cell from a xib instead of the storyboard.
This is my ViewController
You need to register your nib object.
In viewDidLoad()
:
let nib = UINib(nibName: "nameOfYourNibFile", bundle: nil)
tableView.register(nib, forCellReuseIdentifier: "yourIdentifier")
You also need to return the number of sections:
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
First of all, You have to register your nib object.
yourTable?.register(UINib(nibName: "yourCustomCell", bundle: nil), forCellReuseIdentifier: "cellIdentifier")