You can create your prototype cell in a .xib file and import it into several subclasses of UITableViewController . Just make sure the identifier is synchronized between your links in the code and your prototype cell.
class YourViewController: UITableViewController { func viewDidLoad() { super.viewDidLoad() let nib = UINib(nibName: "your_file_name", bundle: nil) tableView.registerNib(nib, forCellWithReuseIdentifier: "your_cell_identifier")
The same applies to custom prototypes of UICollectionViewCell and their use in subclasses of UICollectionView .
source share