Go from one screen to another in SwiftUI
Saurabh Chavan

Saurabh Chavan @100rabhcsmc

About: React Native,iOS, SwiftUI 💻🥣🛌🔄

Location:
Pune,Maharashtra
Joined:
Jun 26, 2020

Go from one screen to another in SwiftUI

Publish Date: Mar 27 '23
2 0

In this post we will be explore how can we navigate from one screen to another using the NavigationLink

import SwiftUI


struct ContentView: View {
    var body: some View {
        NavigationView {
            List(1..<30){ row in
                NavigationLink{
                    Text("Details \(row)")
                } label: {
                    Text("Row \(row)")
                }

            }
            .navigationTitle("SwiftUI")
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
Enter fullscreen mode Exit fullscreen mode

Output

Image description

Comments 0 total

    Add comment