HomeiOS Developmentios - Switching element view of NavigationSplitPane requires again button if nested...

ios – Switching element view of NavigationSplitPane requires again button if nested Navigation Stack


I’ve a essential menu utilizing a NavigationSplitView. Once I choose a kind of objects within the checklist, the element facet adjustments to the corresponding view. That works nice.

If you choose an merchandise within the subview, you get the element part of the merchandise you clicked, with a again button to take you again one degree.

The issue is, if you’re already on the “element view” and also you click on on the primary menu objects from the far left menu, it would not change the dad or mum element pane until you click on on the “again button” that’s within the subview. Is there a method to make the subview change instantaneous and never require a further “again button” press?

NavigationSplitView
{
      Checklist(mainMenuItems, choice: $selectedMainMenuItem)
            { merchandise in
                NavigationLink(worth: merchandise)
                {
                    Textual content(merchandise.identify)
                }
                
            }
} element:
        {
            if let selectedMainMenuItem
            {
                swap(selectedMainMenuItem.identify)
                {
                case "Link1":
                    SectionView1()
                case "Link2":
                    SectionView2()
                case "Link3":
                    SectionView3()
                default:
                    Textual content("")
                }
                
            }
            
        }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments