pavankataria / SwiftDataTables

A Swift Data Table package, display grid-like data sets in a nicely formatted table for iOS. Subclassing UICollectionView that allows ordering, and searching with extensible options.
MIT License
448 stars 69 forks source link

Change font? #39

Open makslevental opened 5 years ago

makslevental commented 5 years ago

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

altagir commented 5 years ago

by using apperances

makslevental commented 5 years ago

@altagir what does this mean?

pavankataria commented 5 years ago

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?

madhavajay commented 5 years ago

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.

pavankataria commented 4 years ago

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.

altagir commented 4 years ago

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

pavankataria commented 4 years ago

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.

PerplexedFox commented 4 years ago

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?