Skip to content

Instantly share code, notes, and snippets.

@MrRooni
Last active July 3, 2020 13:32
Show Gist options
  • Select an option

  • Save MrRooni/3ce8e377e21f424299b69b945f973092 to your computer and use it in GitHub Desktop.

Select an option

Save MrRooni/3ce8e377e21f424299b69b945f973092 to your computer and use it in GitHub Desktop.

I have a basic List row I am building that has a large number on the leading edge followed by a title and subtitle next to it:

HStack {
	Text("26")
		.font(.title)
	VStack(alignment: .leading) {
		Text("Some title")
			.font(.body)
			.bold()
		Text("Some subtitle")
			.font(.caption)
	}
}

The trouble I'm running into is

GeometryReader { geometry in
	HStack {
		Text(weekNumberDateFormatter.string(from: self.note.identifier))
			.font(.title)
			.frame(width: geometry.size.height * 1.2)
		VStack(alignment: .leading) {
			Text(self.note.firstTextRowText())
				.font(.body)
				.bold()
			Text(self.note.secondTextRowText())
				.font(.caption)
		}
	}
}
@MrRooni
Copy link
Author

MrRooni commented Jul 3, 2020

image

@MrRooni
Copy link
Author

MrRooni commented Jul 3, 2020

image

@MrRooni
Copy link
Author

MrRooni commented Jul 3, 2020

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment