Reuse cell from another table VC in same storyboard [duplicate]

By : Ramis

Lets say in storyboard I have two table view controllers (A and B). In the A controller I did create cell prototypes with identifiers: VIENS and DU. In the B controller I need to use cell with identifier DU. I do not want to create same look and feel cell prototype in the B controller once again. Is here a way to reuse cell DU from A controller in the B controller? If yes then how to do it?

By : Ramis

The best way to do this is to not define the cell in the storyboard at all.

Create a separate NIB file and define the UITableViewCell in there. Then you can register the nib with the table and load it from there. Now you just have one copy of the definition of the cell but it can be used in multiple places.

Check my question here...

UITableView registerNib:forCellReuseIdentifier:

It isn't a duplicate question but it will show you how to define and register the nib.

This video can help you solving your question :)
By: admin