SwiftUI: How to use NavigationLink
SwiftUI is a different breed of language, but one that I am getting used to and am even making new apps in the UI.
Thank you for reading this post, don't forget to subscribe!
One thing that my apps are known for are easy to read an understand tableViews. You can see an example of this by looking at one of my (popular) apps here.
We all know how to make a basic list by using the List option. But the challenge was, getting another view controller to show up when someone selects an option. That’s where NavigationLink comes into play.
Here’s a simple example of how to use it:
NavigationLink(destination: anotherViewController())
{
Text(“Option’s Name”).font(.headline)
}
In order for this to work, the “anotherViewController” must already exist. The Text option will display what the tableView cell is, and then we top it off with a .font command so the end user can see the option easier.
You’ll have to do this for each option in a list.