Skip to main content

Layout Direction

extension Element {
func layoutDirection(_ direction: LayoutDirection) -> Element & Layout {
}

QuickLayout supports both left-to-right (LTR) and right-to-left (RTL) directions, enabling seamless content layout across diverse languages and locales. By default, the direction is determined by the user's locale; however, you can utilise the layoutDirection modifier to override this setting for a specific tree of elements.

Examples

var body: Layout {
HStack {
profilePhoto
Spacer(8)
userName
Spacer()
}
.layoutDirection(.rightToLeft)
}