SwiftDataTables icon indicating copy to clipboard operation
SwiftDataTables copied to clipboard

Allow text to wrap up to the next line

Open hamzabinamin opened this issue 5 years ago • 8 comments

Would be really helpful to wrap longer text on to the next line instead of making the font smaller.

hamzabinamin avatar Jun 28 '19 12:06 hamzabinamin

@pavankataria did you get a chance to take a look at this?

hamzabinamin avatar Jul 08 '19 15:07 hamzabinamin

Hi @hamzabinamin, yes, this is again related to autolayout and it's not something I've tried to resolve just yet since it's quite complicated having had to create auto calculating cell heights in collection views. In the past I resorted to using what I believe is called a self sizing class but it got ugly in terms of coding and doesn't fair well when there's varying types of cells.

I have a hard time figuring out how I'm going to resolve this as this requires the autolayout engine to calculate what the height of the cell will need to be and I'm not sure how to achieve this the correct way.

I'd be very interested to have someone explore this issue further and finding out potential ways to resolve automatic height calculation with autolayout. I'd also be interested in a one for all solution but also for an interim solution that doesn't require the use of self sizing cell classes.

pavankataria avatar Jul 31 '19 12:07 pavankataria

@pavankataria Its been a while, hope you're doing okay!

Has there been any update regarding this feature?

hamzabinamin avatar Jun 17 '20 14:06 hamzabinamin

Hi @hamzabinamin I'm afraid until an elegant solution hasn't been found I can't implement it. I don't want to explore hacky options as there needs to be a long term solution. I'll need some help in this regard but waiting for the right individual to come along who has experience in creating custom UICollectionView layouts which works well with Autolayout. It's actually harder than it seems. Sorry for now.

pavankataria avatar Jun 18 '20 00:06 pavankataria

I am working on this, as you can see in this prototype I'm working on you can see cells self size just fine, the issue is that the other cells don't expand their height which would look visually more appealing. image

pavankataria avatar Jun 26 '20 14:06 pavankataria

@pavankataria Before populating the cells, can't we calculate the max number of lines a value can utilize and update the table view row height for all cells?

hamzabinamin avatar Jun 28 '20 10:06 hamzabinamin

It's hacky and only sort of works for this scenario, it's not a scalable solution. Imagine cells that can have any kind of view which doesn't depend on textfields. For example a button, or an image etc, they should also self size. The behaviour we want is that the cells in the same row should resize to the tallest cell after the autolayout engine has calculated the heights of all the cells in the row.

I'm still working on a solution. It may take a while but I'm working on a viable solution.

pavankataria avatar Jun 29 '20 02:06 pavankataria

@pavankataria Were you able to figure out something?

hamzabinamin avatar Nov 20 '22 11:11 hamzabinamin