Chapter 20, setting height for datepickercell

Hello,

I’m confused about setting height for the datePickerCell. You manually set the datePickerCell height to 217 in the storyboard, however, you also call the tableView(:heightForRowAt) to set the row height to 217. Why you set height two times?

@jiang The table view doesn’t know the datePickerCell height you set in the storyboard because the cell isn’t part of the table view.

You add the cell to the table view in code since it’s a static one, so you override tableView(_:heightForRowAt:) to set its height.

Please let me know if you have any other questions or issues about the whole thing. Thank you!

1 Like

Do you mean the row height and cell height are different things?

This topic was automatically closed after 166 days. New replies are no longer allowed.