SwiftDataTables icon indicating copy to clipboard operation
SwiftDataTables copied to clipboard

Changing color of only one cell inside a row.

Open hamzabinamin opened this issue 5 years ago • 8 comments

I have two questions:

  1. You have the two functions for highlighted and unhighlighted row. But I want to show different color for only one cell of a row, not the entire row. Is that somehow possible?

func dataTable(_ dataTable: SwiftDataTable, highlightedColorForRowIndex at: Int) -> UIColor func dataTable(_ dataTable: SwiftDataTable, unhighlightedColorForRowIndex at: Int) -> UIColor

  1. Also if I wanted to use these functions for the entire row, how would I use them in a scenario such as the following:
if value < 0 at row 4 {
    // change color of row 3 to red
   // how do I call the delegate method here to choose the row?
}

hamzabinamin avatar Jul 29 '18 18:07 hamzabinamin

@pavankataria Would you be able to add this in the coming days? How long would it take?

hamzabinamin avatar Aug 01 '18 18:08 hamzabinamin

Hey there, I sure can. I've just been thinking about the implementation of the API and how users would best want to interface with a feature like this. Have you tried implementing this yourself? Might be worth a shot. Suggestions are welcomed.

pavankataria avatar Aug 02 '18 08:08 pavankataria

@pavankataria I was unsuccessful in coming up with a solution lol. Did you get a chance to look into this?

hamzabinamin avatar Aug 16 '18 19:08 hamzabinamin

Okay @hamzabinamin, i'll take a look at this on the weekend!

pavankataria avatar Aug 29 '18 22:08 pavankataria

@pavankataria did you get a chance to figure this out?

hamzabinamin avatar Oct 19 '18 19:10 hamzabinamin

Hey it's been extremely busy for me! A pull request is welcome! Look at how I highlight the entire column, create another method but do it for a single cell.

pavankataria avatar Oct 27 '18 09:10 pavankataria

@hamzabinamin have you worked this out? I'd love a pull request, otherwise I'll have to implement this with a delegate method

pavankataria avatar Feb 07 '19 14:02 pavankataria

@pavankataria Hey, we've put a hold on this feature for now. Unfortunately there wasn't much time to implement that. If you can include that in the delegate methods then that would be great man.

hamzabinamin avatar Feb 09 '19 13:02 hamzabinamin