From the course: SwiftUI Essential Training

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Challenge: Replace MenuView

Challenge: Replace MenuView

(upbeat music) - [Instructor] Okay, time for another challenge. We've made the MenuGridView, but kept it in a testing version that won't work with our full app. I'd like to be able to switch between and MenuGridView and MenuItemView, so get ready to do that. We're going to set up MenuGridView to be able to replace MenuView. There's a missing gesture to make that work, so you're going to have to add that as well. And to test you did it right, I want you to add a button that will switch between the two views in our order toolbar. And we'll use a square.grid.3x2 and a list.bullet on the button to indicate them. Now, I only want to see that button when it's right in context, so it should be on the menu mode only. It shouldn't show up when we're in order mode. So go ahead and give that a try and see what you can come up with.

Contents