Help Navigating Screens

Here is the code recently, the solution didn’t work, the button/navigation still isn’t working. Can someone show me it through the screens that I have

import SwiftUI

struct WelcomeView: View {
    var body: some View {
        
        ZStack {
            Image("birthday")
                .resizable()
                .scaledToFill()
                .edgesIgnoringSafeArea(.all)
                
            VStack(alignment: .center) {
            Spacer()
            
            Text("Welcome to Smilon!!")
                .font(.largeTitle)
                .fontWeight(.bold)
                .foregroundColor(Color.black)
                .multilineTextAlignment(.center)
            
            
            Spacer()
            
            Button("Join") {
                //go to AboutUs view
            }
            .padding(.all)
            .shadow(radius: 2)
            .font(.title)
            
            Text("By tapping Join, you agree to our privacy policy")
                .fontWeight(.bold)
                .foregroundColor(Color.black)
                .padding(.all)
                    
            .navigationTitle("Welcome View")
            .navigationBarTitleDisplayMode(.inline)
            }
            
        }
}

    struct WelcomeView_Previews: PreviewProvider {
    static var previews: some View {
        WelcomeView()
    }
}
}

But you didn’t. The third method Chris showed for triggering navigation to another screen used a NavigationLInk; there is no NavigationLink in your code anywhere. As far as I can see, all you did was add .navigationTitle() and .navigationBarTitleDisplayMode() modifiers. Those don’t give you the ability to navigate to other screens.

One more time: You haven’t put anything inside the action closure of your Button. How do you expect the Button to do anything if you don’t tell it what to do? You need to put something in there besides a comment to tell your code to move to another screen. This is where the first or second method Chris showed you could be used, for instance.

As an example, using the second method Chris showed:

struct WelcomeView: View {
    @State private var moveToAbout = false
    
    var body: some View {
        
        ZStack {
            Image("birthday")
                .resizable()
                .scaledToFill()
                .edgesIgnoringSafeArea(.all)
            
            VStack(alignment: .center) {
                Spacer()
                
                Text("Welcome to Smilon!!")
                    .font(.largeTitle)
                    .fontWeight(.bold)
                    .foregroundColor(Color.black)
                    .multilineTextAlignment(.center)
                
                
                Spacer()
                
                Button("Join") {
                    moveToAbout.toggle()
                }
                .padding(.all)
                .shadow(radius: 2)
                .font(.title)
                .fullScreenCover(isPresented: $moveToAbout) {
                    //nothing here
                } content: {
                    AboutUs()
                }

                Text("By tapping Join, you agree to our privacy policy")
                    .fontWeight(.bold)
                    .foregroundColor(Color.black)
                    .padding(.all)
            }
        }
    }
}

struct WelcomeView_Previews: PreviewProvider {
    static var previews: some View {
        WelcomeView()
    }
}

(Note too that you had your preview inside of WelcomeView.)

I have been going through that Chris said on the last post again with the three methods for nagivation and I am doing the third one and I came across two errors, also can you tell me if I’m doing this right now?

import SwiftUI

struct ContentView: View {
    @State private var isShowingWelcomeView = false
    @State private var isShowingAboutUsView = false
    @State private var isShowingEventView = false
    @State private var isShowingMessageView = false
    @State private var isShowingEndView = false
     
    var body: some View {
        NavigationView {
        
        ZStack {
            Image("birthday")
                .resizable()
                .scaledToFill()
                .edgesIgnoringSafeArea(.all)
            
            
            VStack(alignment: .center) {
                Spacer()
                Text("Welcome to Smilon!!")
                    .font(.largeTitle)
                    .fontWeight(.bold)
                    .foregroundColor(Color.black)
                    .multilineTextAlignment(.center)
                
                Spacer()
                
                Button("Join") {
                    
                }
                .padding(.all)
                .shadow(radius: 2)
                .font(.title)
                .foregroundColor(Color.black)
                
                // Navigate using a Navigation Link
                NavigationLink(destination: AboutUsView()) {
                }
                    
                    .navigationTitle("Welcome")
                               .sheet(isPresented: $isShowingWelcomeView) {
                                   WelcomeView()
                               }
                               .fullScreenCover(isPresented: $isShowingAboutUsView) {
                                   AboutUsView(isShowingAboutUsView: $isShowingAboutUsView)
                                   
                                       .fullScreenCover(isPresented: $isShowingEventView) {
                                                       EventView(isShowingEventView: $isShowingEventView)
                                           
                                               .fullScreenCover(isPresented: $isShowingMessageView) {
                                                              MessageView(isShowingMessageView: $isShowingMessageView)
                                                   
                                                       .fullScreenCover(isPresented: $isShowingEndView) {
                                                                      EndView(isShowingEndView: $isShowingEndView)
                                                   
                                                       
                               }
                           }
                }
                
                Text("By tapping Join, you agree to our privacy policy")
                    .fontWeight(.bold)
                    .foregroundColor(Color.black)
                    .padding(.all)
                
            }
        }
        
    }

    

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

}
    }
}

can someone please tell me how to fix these erros

I mean this in the nicest possible way, but…

You can’t solve a problem by just throwing code at it. You need to understand the code samples people give you before you can use them correctly.

Once again I would like to gently suggest refreshing your knowledge by going back over some of the courses or even looking at other resources as well. Navigation is a fundamental aspect of a SwiftUI app and you seem to lack even a cursory understanding of it. You need to know what the difference is between the various methods of navigating through different screens.

I also note that you still have not added any code to the action closure of your Button, even after I gave you an example of what to do. If you don’t want to trigger navigation from a button tap, that’s fine, but then why is that Button there in the first place?

Please take some time to really study the examples people have given you and also refresh your learning before trying to solve your navigation issues again. Stepping back from the immediate problem to gain a better understanding of what you are trying to do will not only help in this case but moving forward as well.