Learn Courses My Dashboard

What ARE Nav. Link's tag & selection parameters?

I’ve realized that I’m a little confused about what the tag and selection parameters are for a Navigation Link. Can someone confirm I’m understanding these right and/or set me on the right path if I’ve got it wrong?

  • I think that the selection parameter is a binding to identify what Label the user tapped on? (Or to set programmatically if you want change the destination programmatically.)

  • I think the tag parameter is an identifier (Int or String or maybe something else) to identify the destination a link goes to.

  • I’m pretty sure that the Navigation View only navigates to a view if the tag parameter and selection parameter match each other.

If the above is correct, then I don’t understand why every navigation link has a selection parameter instead of just putting the selection parameter on the navigation view. Wouldn’t you only ever be able to select one link at a time? Is it just to change the value stored in the binding whenever a user taps there?