0

Hi I'm new to swiftUI and I'm stuck in a issue. Description: The problem is to navigate to a screen of different tab.

Ex: I have a view in tabItemB which displays a selected list of student id's who belong to different class sections like class 5A and 5B. When I click a image stacked horizontally with studentID it must navigate to tabItemA and pick the student data cell from the Student listView which displays list of all student id's and name with section headers as 5A and 5B and then navigate to a screen which contains the selected student data.

Once I've viewed my data, on clicking back button I should be displaying tabItemA view.

The student struct be like:

struct Student: Identifiable {
    let id: Int
    let name: String
    let address: String
    let section: String
}

Please let me know if this is possible.

I've tried by passing selectionID as List(selection: $selectedId) but this is moving to a View with no StudentData. Tried to use navigationLink(isActive:), but isActive is deprecated in iOS 16. Cannot present the view as I need to navigate back to tabItemA on selection of back button.

I just want to understand how can I navigate.

Any help would be appreciated.

Thanks in advance.

Mishku
  • 1
  • 1

0 Answers0