---
title: "userInterfaceLayoutDirection(for:)"
framework: uikit
role: symbol
role_heading: Type Method
path: "uikit/uiview/userinterfacelayoutdirection(for:)"
---

# userInterfaceLayoutDirection(for:)

Returns the user interface direction for the given semantic content attribute.

## Declaration

```swift
class func userInterfaceLayoutDirection(for attribute: UISemanticContentAttribute) -> UIUserInterfaceLayoutDirection
```

## Parameters

- `attribute`: The semantic content attribute for a view.

## Return Value

Return Value The user interface layout direction (left-to-right or right-to-left).

## Discussion

Discussion When creating a view that contains subviews, you can use this method to determine whether the subviews should be flipped, and lay out the views in the appropriate order.

## See Also

### Adjusting the user interface

- [overrideUserInterfaceStyle](uikit/uiview/overrideuserinterfacestyle.md)
- [semanticContentAttribute](uikit/uiview/semanticcontentattribute.md)
- [effectiveUserInterfaceLayoutDirection](uikit/uiview/effectiveuserinterfacelayoutdirection.md)
- [userInterfaceLayoutDirection(for:relativeTo:)](uikit/uiview/userinterfacelayoutdirection(for:relativeto:).md)
