Navigation from one screen to another screen in SwiftUI

Apple provides two ways to navigate from one screen to another.

  1. Navigation (Push and Pop)
  2. Present and Dismiss

Here, we’ll look Navigation (Push and Pop) ,

Step1. Create one extension for View, This is a generic modifier you can use it multiple times in a view for multiple button navigation.

Use this View extension as shown,

To create a Generic View Modifier, reference is taken from,




iOS Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store