swiftui text align to leading in swift

To align a text to the leading in SwiftUI, you can use the .multilineTextAlignment(.leading) modifier. Here's an example:

main.swift
import SwiftUI

struct ContentView: View {
    var body: some View {
        Text("Hello, Leading Alignment!")
            .multilineTextAlignment(.leading)
    }
}

166 chars
10 lines

In this example, the text "Hello, Leading Alignment!" will be aligned to the leading.

related categories

gistlibby LogSnag