MultilineTextAlignmentModifier.swift 429 B

1234567891011
  1. extension View {
  2. /// Sets the alignment of lines of text relative to each other in multiline
  3. /// text views.
  4. ///
  5. /// - Parameter alignment: The direction to align the text in.
  6. public func multilineTextAlignment(_ alignment: HorizontalAlignment) -> some View {
  7. return EnvironmentModifier(self) { environment in
  8. return environment.with(\.multilineTextAlignment, alignment)
  9. }
  10. }
  11. }