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?
Asked
Active
Viewed 1.2k times
1 Answers
25
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.

Community
- 1
- 1

Fogmeister
- 76,236
- 42
- 207
- 306
-
yep, probably the better way than mine. – nburk Oct 13 '14 at 14:25
-
is this answer still valid, or are there any changes for ios 10 ? – cloudnaut Oct 11 '16 at 14:38
-
same than jeven, any news or changes for ios 10 ? – Phoenix Feb 16 '17 at 12:24
-
1@Phoenix this isn't gonna change for any version of iOS. When you define a view in a storyboard it is relevant only to that view controller scene. There are already ways that you can share a cell between view controllers. Just don't define it in a storyboard. – Fogmeister Feb 16 '17 at 12:26