Making use of DoubleColumnNavigationViewStyle

As mentioned in the previous section, DoubleColumnNavigationViewStyle for our particular style of app will serve as the best option and make the best use of what SwiftUI has to offer for iPadOS.

Let's start by taking a look at exactly what this will do for us. Head on over to ContentView.swift and change our previously added .navigationViewStyle modifier to the following:

.navigationViewStyle(DoubleColumnNavigationViewStyle())

Now, if not already done, press resume and check out the automatic preview canvas—notice something different? That's right—because we've selected an iPad device in our device list, our canvas has automatically changed to an iPad layout and, with any luck, you should now ...

Get Learn SwiftUI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.