pavankataria/SwiftDataTables

Change font?

makslevental opened this issue · 8 comments

Is there a way to change the fonts without messing with the xibs?

by using apperances

@altagir what does this mean?

Yeah so you can either use either the UIAppearance class as altagir mentioned though I do think there's a strong case to allow the user to provide their own custom view and this could solve so many appearance related requests.

I just don't know the best way to deal with resizing since the data table currently manually resizes each row. I just haven't thought about how this would work in relation to laying out the custom views rows and populating the row itself since it's a custom one..

It's a case of deciding who is going to be responsible for populating the row. You could argue if you provide a custom view then the library won't pass in the data itself and that it's up to the user to do that.

Any thoughts?

It's a real pity, I was trying to use this but unfortunately the inability to change fonts and font sizes and control if the font text wraps or gets shrunk made this unusable. So plus +1 to having more control over the text in each cell.

Was hoping this would generate some noise but it's been relatively quiet. I'm hoping there's a clean way to allow text wrapping of cells in SwiftDataTable. This does require working out the height of each cell. If this is possible using the Autolayout engine to determine the size that would be best.

custom cell with automatic dimension tableview.rowheight = UITableViewAutomaticDimensionn

then use autolayout in a custom UITableViewCell to constraint height

ideally SwiftDataTable should provide a setter to set a custom nib

So I'm not using tableviews here, and SwiftDataTables uses collection views with fixed heights defined. Using auto layout engine to determine the sizes of each row is the ideal scenario.
Though while scrolling, as you don't want to calculate sizes of all the rows since they're not all presented.

I think the first step is to allow custom cells, though the issue still remains, these custom views will be squashed to the cell attributes defined by SwiftDataTables. What people want are word wrapped cells that automatically resize and take the necessary height, and to apply that height to the reset of the cells in that row.

If anyone wants to take a stab at implementing autolayout self resizing cells that would be good.

Hi, @pavankataria so I would like to be able to change the font size of the cells and headers, but keeping other SwiftDataTable-unrelated labels as they were. What is the best way to do it?