Clean up state or print out debug information just before leaving the scope by defining the defer statement can improve development a lot.

In this tutorial, you’ll use SwiftUI to implement the navigation of a master-detail app. You’ll learn how to implement a navigation stack, a navigation bar button, a context menu and a modal sheet.