Switching Screens

Hello! I am relatively new to xcode and I’m learning how to build an app right now. My app involves a basically a home screen with multiple annotated images that act as buttons (sort of like a product page).

I need to set it up so that when someone clicks on one of these images, it switches into a new screen in the app. What action do i specify so that the view switches from the home screen to the item-specific screen? I’ll include photos of the two screens below.

This is the home screen

When someone clicks on the top left image/square on the home screen, I need the screen to switch to this one.

Any help on this is appreciated or on how to switch screens. Very new to this so I apologize if this is a dumb question. Thanks!

Hi Scott,

Welcome to the Code Crew community.

Are you using UIKit (Storyboard) or SwiftUI?

I’m using Swift UI right now

Hey Scott,

For SwiftUI, what you need to use is “navigationview” and “navigationlink”
Just google either of these phrases in google and you’ll find a code example for you to follow!

1 Like

Thanks for the help! I just watched a video and spent an hours implementing this and it’s work perfectly