EurekaCommunity/SplitRow

SplitRow separatorStyle should be configurable

marbetschar opened this issue · 6 comments

We should expose the possibility to set the SeparatorStyle for the SplitRow with a public property called separatorStyle which subsequently sets the tableViewRight.leftSeparatorStyle to the user defined value:

tableViewRight.separatorStyle = .none
tableViewRight.leftSeparatorStyle = .singleLine

@kmav as I do not have access to macOS right now, feel free to create a pull request with the changes needed to make separatorStyle configurable.

I guess we should also make separatorColor available for customization in the same way we make separatorStyle available.

kmav commented

In my case, that I wanted to have two adjacent fields, the leftmost as textrow and the rightmost as button, that issue (separator) appeared because I wanted the button on the right to be a different color (green) than the default. When the two fields of the row had the default color, there was no issue (separator was "hidden").

Screenshot 2020-04-20 at 13 12 26

May I ask, in order to understand, what is the purpose and use of the separator/separatorView?
Where we need it in UI development?

@kmav I'm not sure I understand your question: The UITableViewCell's separator is the default way to separate two UITableViewCells from each other and is used in every UITableView - so from my point of view the question would rather be why avoid it in SplitRow which places two UITableViewCells next each other?

By default the SplitRow looks like in the following Screenshot, which is part of the README - there you can see its clearly visible:

SplitRow Separator

Ideological views put aside: The separator has been there since the very first version of SplitRow and removing it causes a breaking change. Because a lot of people were just fine with it in the past and the breaking change can easily be avoided by making its behaviour configurable, I don't see the need of removing it.

EDIT: Added Screenshot to showcase default behaviour.

kmav commented

Thank you very much for the clarification.

So, is it like what we have in a standard table view (horizontal thin lines) in a vertical way?
I see that in your code it is implemented as an additional View. I am not sure that this vertical separation is something default in UITableView but it is fine. This component is used by a lot of people and existing functionality should be preserved.

Although with too much difficulty, I see the separator in the screenshot now (I had to zoom) :)

As I can see (and experienced in my issue) the separator has not the same height as the horizontal row. It is smaller. That is one way to explain the reason for my issue: with a green field, the separator takes a portion of the left border but not ALL of it. If the length (height) of the separator was equal to the row height then maybe there will be no visible issue for me (i.e. for fields with color) :)
Do you get my point?

With all of my "analysis", I am just brainstorming and trying to understand or propose ideas and help. Your work is excellent and very useful!

In any case, we can proceed in the way you suggest (once I get some time) :)

Best regards,
Kostas

Although with too much difficulty, I see the separator in the screenshot now (I had to zoom) :)

May also depend on the screen how well its visible ;)

With all of my "analysis", I am just brainstorming and trying to understand or propose ideas and help.

Don't worry, no hard feelings here.

As I can see (and experienced in my issue) the separator has not the same height as the horizontal row. It is smaller.

The original idea was to mimick the stock iOS Contacts app in edit mode, there you also got this vertical separator - which is not 100% in height as well (email an phone fields for example).

So, is it like what we have in a standard table view (horizontal thin lines) in a vertical way?

Can't remember the exact details how I got there, totally possible I used an additional view to put everything together - but I guess your basic assumption is correct. The only thing I remember is, it was quite a challenge to put the pieces in the right place :)