From the course: Complete Guide to SwiftUI

Unlock this course with a free trial

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

Modifying tab bars

Modifying tab bars

- [Instructor] With tab bars in place, there's a few things you can do to a tab view that you might want to be aware of. First, you can add badges to the tabs. I can count the number of orders using the badge modifier after the tab. So for example, let's go to the Orders tab here, and I can add a badge using the badge modifier. We'll put a count on the badge so I can put in orders, for example, orderCount. And now I have here a little badge. So if I hit the Huli chicken, for example, and I hit $15, see what happens. We've got another one on here, let's go down over here, let's do a margarita pizza, and I'll click that one, and now I have two. The second is the tab view styles. Depending on your platform, you'll find different kinds. watchOS, for example, has a few more than the other platforms. The three you'll find the most often on devices is the default of automatic tab bar only, which is the visual we have right now, and pages. Automatic chooses the best for the environment you're…

Contents