1

There are advantages to designing a cell (in a table view or collection view) inside the table/collection, within a storyboard: You get to see the design in context, and you don't have to register the cell in code.

However, it breaks down a bit if you use the same cell in different tables / collection views.

As far as I can see, you have to have copies of the cell design in each table view. This is not very DRY.

I could always use registerNib with a separate xib for the cell, but this removes it from the storyboard.

What is the best practice for doing this? Is there a way to have a reference to a separate cell xib in the storyboard so I can see in in context?

cannyboy
  • 24,180
  • 40
  • 146
  • 252
  • 1
    I use the registerNib approach when I want to share them and then in the storyboard when they are unique. I've never found a way to share them across stoyboards – Simon McLoughlin Jul 31 '15 at 10:56
  • 1
    Please take a look into this http://stackoverflow.com/questions/9245969/in-a-storyboard-how-do-i-make-a-custom-cell-for-use-with-multiple-controllers, it may be useful – teamnorge Jul 31 '15 at 11:00

1 Answers1

0

You can do this with storyboard too. Set the custom class for UITableViewCell. You can use the same for multiple tableview.

Bhanupriya
  • 1,202
  • 1
  • 9
  • 20