Text
1 ya da daha fazla satır yazı görüntülemek için kullanılır.
// 1
Text("Simple Text") // Hardcoded string
// 2
var constString = "Text from variable"
Text(constString)
// Struct kullandığımız için 'constString' düzenleyemeyiz.
// 3
@State var modifiableString = "You can change me!"
Text(modifiableString)
// Düzenleme yapmak istiyorsak @State propertyWrapperını ekleriz.
// Böylelikle herhangi bir blok içinde düzenleyebiliriz.
// XCode'dan ilgili dokümanı inceleyebilirsiniz.
Text("Any Text")
.font(.title)
.fontWeight(.bold)
// Hazır gelen Font Seçenekleri
.largeTitle
.title
.headline
.subheadline
.body
.callout
.footnote
.caption
.system(
_ style: Font.TextStyle,
design: Font.Design = .default
) -> Font
.system(
size: CGFloat,
weight: Font.Weight = .regular,
design: Font.Design = .default
) -> Font
.custom(_ name: String, size: CGFloat) -> Font
// Hazır gelen FontWeight seçenekleri
Font.Weight
.ultraLight
.thin
.light
.regular
.medium
.semibold
.bold
.heavy
.blackLast updated