Section collapse triangle for section header no longer supported with NavigationStack?

Since NavigationView is now deprecated, I’m trying to update my code to use NavigationStack instead. However, I found that when using NavigationStack, section headers within an overall List view no longer have the collapsing triangle functionality. This used to work for NavigationView, List view, Section headers. Am I missing something? Is there a way to get back the section header collapse triangle within an overall List view when encapsulating within a NavigationStack?

  • Upon further reading...it appears that the default for Section headers going forward will be to NOT show expansion arrows. To use expansion arrows, a new isExpanded parameter needs to be included in the Section initializer and will be needed to bind to a state property. I haven't gotten this new approach to work, but seems like the answer.

Add a Comment

Accepted Reply

You are correct in that you have to use the new initialisers with the isExpanded parameter to enable the expansion of sections. However, as of iOS 17 beta 1, this only works for lists with the sidebar style. Having spoken with an Apple engineer, it was agreed that this is not the intended behaviour and all list styles should have expandable sections. I did file a feedback report (FB12277169) so this should be resolved soon.

  • Thanks. I don’t specify the list type so I think I get the default, which I believe is the sidebar style. By the way, I don’t know why I don’t know this, how do I see feedback that others have submitted to Apple so that I can watch those. Like the feedback number that you provided. Isn’t there a way to do this?

  • I think that’s only for Apple to see, so they can note or forward it on, as I can’t see others’ either.

Add a Comment

Replies

You are correct in that you have to use the new initialisers with the isExpanded parameter to enable the expansion of sections. However, as of iOS 17 beta 1, this only works for lists with the sidebar style. Having spoken with an Apple engineer, it was agreed that this is not the intended behaviour and all list styles should have expandable sections. I did file a feedback report (FB12277169) so this should be resolved soon.

  • Thanks. I don’t specify the list type so I think I get the default, which I believe is the sidebar style. By the way, I don’t know why I don’t know this, how do I see feedback that others have submitted to Apple so that I can watch those. Like the feedback number that you provided. Isn’t there a way to do this?

  • I think that’s only for Apple to see, so they can note or forward it on, as I can’t see others’ either.

Add a Comment

I think that’s only for Apple to see

Correct. My Bug Reporting: How and Why? post explains this and also offers some options.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"