Today we’re going to complete your knowledge of SwiftUI navigation by looking at the customization options available to us: customizing the navigation bar appearance, placing toolbar buttons in exact locations, and also letting users edit the navigation title.
Of the three, the middle one is the most important because it comes in two variants: we can either force exact positions of buttons, or we can semantic locations that allow SwiftUI to place the buttons where they make sense for the current platform – and also apply extra styling as appropriate.
A Steve Jobs quote I love is, "Some people think design means how it looks. But of course, if you dig deeper, it's really how it works." This is the power of a declarative layout system like SwiftUI: by giving extra information to the system, by describing the role something has, SwiftUI takes care of making it work the correct way automatically – it's much easier than trying to do it all ourselves.
Today you have three topics to work through, where you’ll learn about custom navigation bar appearances, hiding the back button, toolbar placements, , and more.
Great job on finishing another day! If you still have questions about what you learned, please send them in using this form – I'll do my best to address the most common problems in the next course update. Thank you!
If you use Twitter, the button below will prepare a tweet saying you completed today, along with a celebratory graphic, the URL to this page, and the challenge hashtag. Don't worry – it won't be sent until you confirm on Twitter!
Alternatively, copy and paste the text below to your preferred social network - I'm @twostraws on Mastodon.social, Bluesky, and Threads.
🎉 I just finished Day 45 of the #100DaysOfSwiftUI at https://www.hackingwithswift.com/swiftui/45 via @twostraws
Need help? Tweet me @twostraws!
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
The 100 Days of SwiftUI is a free collection of videos, tutorials, tests, and more to help you learn SwiftUI faster. Click here to learn more, or watch the video below.
Link copied to your pasteboard.