Rounding the height of a table cell in Swift


Rounding the height of a table cell in Swift



I need to calculate the cell height of the table and round it to a divisible value by 5. For example, when the cell size is 116, the correct height should be 120.



The point is that I use the adaptive layout to calculate the cell height. One of the subviews of UITableViewCell is a vertical dashed line which should connect to cell below. The dashed line consists of repeating of 5 points - dash (2 points) and gap (3 points). So the height of line view should be rounded up to the value divisible by 5 for correct connection with dashed line of cell wich is below.



Two cells with connected dashed line





Show your tried code?
– Pratik Prajapati
Jun 30 at 11:28





somebody has marked the question as duplicated without understanding the problem - never mind ...
– Kacper Rychliński
Jun 30 at 12:11









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

List of Kim Possible characters

Audio Livestreaming with Python & Flask

NSwag: Generate C# Client from multiple Versions of an API