-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When there is only one section, the section uses row.title as its default value #2127
Comments
This change has caused problems in my project. How can I explicitly set the header title to be row.title if needed? The code change now always sets it to nil. It looks like I could maybe set the header title via optionProvider options but I haven't been able to figure out the right syntax for that. Is there a certain attribute I should use when creating the PushRow? |
You should be able to set section header using |
@mats-claassen that solution doesn't work for me because our design is that there is only 1 section, and that section needs a header title. sectionHeaderTitleForKey doesn't get called because optionsBySections returns nil. Therefore, my code reaches the else in setupForm where header is always set to nil. I don't see a way to override it. |
@kamerc for single section setups you could set |
@mats-claassen that solution was going to be my workaround, I just wanted to know first if there was a better way. Is the best way to access sectionKeyForValue on the SelectorViewController via onPresent? For example, what I have below:
|
Yes, that looks right |
If we use
PushRow
to push a SelectorViewController with only one section, then the section title will be set torow.title
by default, although we don't explicitly do so. Look at the 1st picture.The behavior, that the section title has a default value, is quite confusing. It's different from the default behavior of
UITableView
. The row title has a strong correlation with the pushed view controller title, but not with the section title.Actually, when there is only one section, we only need a view controller title instead of a section title. Look at 2nd picture.
We should remove the default value, and let developers explicitly set the title if they need it.
The text was updated successfully, but these errors were encountered: