Cell from Xib with Swift 3

后端 未结 2 1829
执念已碎
执念已碎 2021-02-04 09:47

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

2条回答
  •  礼貌的吻别
    2021-02-04 10:33

    First of all, You have to register your nib object.

    yourTable?.register(UINib(nibName: "yourCustomCell", bundle: nil), forCellReuseIdentifier: "cellIdentifier")
    

提交回复
热议问题