Reputation: 14320
I have 2 viewcontrollers on my storyboard, which both have a tableview. Now I would like to implement the same cells in both tableviews. Is there a way to easily reuse these cells across multiple viewcontrollers?
Upvotes: 0
Views: 721
Reputation: 432
Yes, It's possible you need to create .nib file with subclassing UITableviewCell
take a look on https://medium.com/@musawiralishah/creating-custom-uitableviewcell-using-nib-xib-files-in-xcode-9bee5824e722#.u8xounci2
you get to know , how to create & use .nib file.
Upvotes: 0
Reputation: 5945
You should reuse full UITableView
for this case. There is no open API for sharing cells between multiple UITableView
s, but you still can reuse UITableView
in case there is no moment when two controllers are shown simultaneously.
Upvotes: 1
Reputation: 373
Yes you can use it by using custom table view cell Example for custom table view cell
Upvotes: 3