ddarellis
ddarellis

Reputation: 3960

How to show a .xib file in a TableViewCell

I have a .xib with an image and a label in the potition that i want.. And i want in the cellForRowAtIndexPath function to set image and label.text then to add then view in the cell and show the cell

Upvotes: 2

Views: 229

Answers (1)

Jonas Schnelli
Jonas Schnelli

Reputation: 10005

Check this: How do you load custom UITableViewCells from Xib files?

But i do not recommend to load UITableViewCells from xib.

You loose performance on a very critical part.

I recommend to create you UITableViewCell subclasses by code. Because inflating a XIB(XML) during scrolling will create buckings.

If you wan't to have a nice, snappy app, then code instead of XIB (at least the UITableViewCell subclasses).

Upvotes: 4

Related Questions