ddarellis
ddarellis

Reputation: 3960

Get .xib height to use it in the heightForRowAtIndexPath function

I have created a custom .xib that contains a TableViewCell that contains a UIImageView And UILabel.

I want to know TableViewCell height in the .xib file, not to set it manually in heightForRowAtIndexPath function.

Also is there a property of UIImage to have the height of the TableViewCell when i change it by hand in the .xib file?

Upvotes: 0

Views: 1270

Answers (1)

UITableViewCell is actually a UIView, so when you load it from xib the frame property can help you:

cell.frame.size.height

Upvotes: 2

Related Questions