Geek Culture
Published in

Geek Culture

How to Stylize Your Text in Swift UI!

Photo by Jeroen den Otter on Unsplash
struct SomeView: View {
var body: some View {
VStack {
Text("Title").font(.title)
Text("Headline").font(.headline)
Text("Subheadline").font(.subheadline)
Text("Body").font(.body)
Text("Callout").font(.callout)
Text("Caption").font(.caption)
Text("Footnote").font(.footnote)
}
}
}
struct SomeView: View {
var body: some View {
Text("Changing Font Size is Easy!").font(.system(size:90)
}
}
struct SomeView: View {
var body: some View {
Text("This is a bold font now!").fontWeight(.bold)
}
}
struct SomeView: View {
var body: some View {
VStack {
Text("Black Font").fontWeight(.black)
Text("Bold Font").fontWeight(.bold)
Text("Heavy Font").fontWeight(.heavy)
Text("Light Font").fontWeight(.light)
Text("Medium Font").fontWeight(.medium)
Text("Semibold Font").fontWeight(.semibold)
Text("Thin Font").fontWeight(.thin)
Text("UltraLight Font").fontWeight(.ultraLight)
}
}
}
struct SomeView: View {
var body: some View {
Text("Red Text").font(.title).bold().foregroundColor(.red)
}
}

--

--

A new tech publication by Start it up (https://medium.com/swlh).

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store