From the course: Complete Guide to SwiftUI

Unlock this course with a free trial

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

Tab bars

Tab bars

- [Instructor] Things are a little crowded on our app. Navigation cleans that up by making different views for differing functions. The first of the major navigation views for Swift UI we'll look at is the tab view. Prior to iOS 18, you encompass views in a tab view and then tag them with a label. However, this is deprecated starting in iOS 18, so I'm going to show you this new way instead. Before we do I'm going to comment out the button in status bar view to toggle between these views. So let's go here, 'cause we won't be needing them anymore. And so let's go down here, we've got the cart menu card one, the one we did earlier. And so this button here now can be commented out. We're going to use the same two symbols of cart and menu card, but we're not need them right away. But we're going to go back over here to content view now. And in our code here, I'm going to clean this up a little bit. Then we use an if else here to move between these two, and we're not going to do that…

Contents