Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happened to the "Prototype Cell" option of UITableView?

I created an app for iPad (not using StoryBoards), with a UITabBarController. I added some labels and textfields at the top of the view. Now, I want to add a UITableView (without the controller) to the window, which it took. When I try to add a UITableViewCell, there is no option for Prototype Cell...

Why? and how do I fix it?

Thank you in advance...

like image 517
SpokaneDude Avatar asked Apr 01 '12 23:04

SpokaneDude


People also ask

What is a prototype cell in iOS?

A prototype cell acts a template for your cell's appearance. It includes the views you want to display and their arrangement within the content area of the cell. At runtime, the table's data source object creates actual cells from the prototypes and configures them with your app's data.

How do you use prototype cells in Swift?

First, design your table cell on Storyboard whatever you want. Now, make a subclass of UITableViewCell and assign this class to your prototype custom cell which you have designed on Storyboard. Also, don't forget to set "reuse identifier in Storyboard table cell.


2 Answers

Only storyboards have prototype cells. Regular non-storyboard-based UITableView objects in Interface Builder do not have prototype cells (static or dynamic).

like image 107
Jack Lawrence Avatar answered Oct 02 '22 15:10

Jack Lawrence


If using IB, and want to create your 'prototype' cell with IB, just create a new xib and lay out your cell. Otherwise, you can create it programatically.

like image 44
bobnoble Avatar answered Oct 02 '22 15:10

bobnoble