I donโt think that you can create a prototype cell and share it between the tables in the storyboard, but you can create a prototype cell in the bank and then load it in the ViewDidLoad method and then use it in your table view. It's really pretty simple, here's how ...
a. add nib file:
1. Select New File ... 2. Select IOS โ User Interface
3. Select "Empty" โ this will add a new .xib file to your project
4. Drag the UITableViewCell from the object browser to your xib file and configure as you wish
5. Use the Utilities panel to change properties โ editing a tip is very similar to editing a storyboard.
6. Make sure you name the cell โ I chose the name cellFromNib, but you probably want something else.
C. Load a UITableViewCell into each tableDidLoad method of the table:
- (void)viewDidLoad { // load the cell in the nib - the nib can only contain this one UITableViewCell [self.tableView registerNib:[UINib nibWithNibName:[self @"nibFileNameWithoutExtension"] bundle:[NSBundle mainBundle]] forCellReuseIdentifier:[self @"cellFromNib"]]; }
C. De-queue nib tableViewCell ...
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellFromNib" forIndexPath:indexPath];
D. Add the โdummyโ prototype to your TableView in your storyboard. Make a selection from this cell "dummy" in the view that you want to display when the cell is selected - be sure to specify a name - I will call it @ "TheSegue" for this example. You will reference this segue in your code.
E. Finally, add code to highlight from this cell ...
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
If you want to specialize your cell code, create a class that subclasses UITableViewCell
I think that is all you need.
I would say donโt be afraid to do something like this, because if you are serious about iOS programming, you will learn something new. It really makes much better reusable code.