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.
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!
Need help? Tweet me @twostraws!
SAVE 50% To celebrate Black Friday, all our books and bundles are half price, 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.
Link copied to your pasteboard.