Swift中的TableViewCell和XIB/NIB有什么区别?什么时候使用什么?
我很困惑,以至于我们可以通过常规tableviewcell来完成我们可以做的.xib/nib。那么它们之间有什么区别以及何时使用什么?
I am so confused that whatever we can do through .xib/nib same thing can be done through normal tableViewCell. So whats the difference between them and when to use what?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用XIB创建一个TableViewCell来设计自定义单元格,并且可以将XIB(Design)与Swift File连接到单元格。
使用XIB创建tableView单元格是如果您的TableView具有多个自定义单元格,则更好的方法是更好的方法。
您可以为tableView创建用于寄存器单元格的扩展名。
然后,您可以将所有自定义单元格注册到TableView,并在UiviewController类中使用它。
You can create a TableViewCell using xib to design your custom cell and you can connect xib (design) with swift file of cell.
Using xib to create TableView Cells is the better way if your TableView has multiple custom cells.
You can create extension for TableView to register cells.
then you can register all custom cells to TableView and use it in UIViewController class.