flâneur — a map of the web's best reading

Polishing designs with fonts and colors - a free SwiftUI by Example tutorial

hackingwithswift.com · 876 words · saved by 1 readers

We’ll add some more to our design in just a moment, but first let’s pause and make what we have look better. In ItemRow.swift, our menu item’s name is clearly the most important thing in each row, but it has the same font size as the price below. We can bring it up in size and weight by using the font() modifier, which accepts any of Apple’s Dynamic Type sizes. So, something like this will make it stand out: As for the picture, it looks OK as it is, but with a little love it would look better. For example, we could apply a clipShape() modifier and ask it to be clipped to a circle shape: Or we could apply a clipShape() modifier, then add an overlay() modifier so we place a shape on top of our image. For example, this will add a circle over the image, then give that circle a 2-point gray border: OK, that’s enough styling – let’s look at something more complex. If you look in menu.json you’ll see that each menu item has a string array of restrictions: “G” for containing gluten, “N” for co

Polishing designs with fonts and colors - a free SwiftUI by Example tutorial WWDC26: Save 50% on my books and bundles! >> < Composing views to create a list row Displaying a detail screen with NavigationLink > Polishing designs with fonts and colors Paul Hudson @twostraws June 16th 2023 Updated for Xcode 16.4 We’ll add some more to our design in just a moment, but first let’s pause and make what we have look better. In ItemRow.swift, our menu item’s name is clearly the most important thing in each row, but it has the same font size as the price below. We can bring it up in size and weight by u

Explore this link on the map →

related reading