Reading time: 1 min

This recipe shows how to make all items in a VStack take up the same width as the widest item. The end result looks like this:

Screenshot%202022-06-03%20at%2008.48.28

The recipe has two components to it:

  1. Telling all items to use maximum width using frame(maxWidth: .infinity).
  2. Telling the VStack to take up the same width us...

Continue Reading...

Reading time: 1 min

Ocassionally you wish to make a View fit entire width of its parent. You can do so by setting both minWidth and maxWidth:

Text("Some text")
  .frame(minWidth: 0, maxWidth: .infinity)

For a Text specifically, this is even more useful if you wish to have it, say, leading-aligned in a center-...

Continue Reading...