userInterfaceLayoutDirection(for:)
Returns the user interface direction for the given semantic content attribute.
Declaration
class func userInterfaceLayoutDirection(for attribute: UISemanticContentAttribute) -> UIUserInterfaceLayoutDirectionParameters
- attribute:
The semantic content attribute for a view.
Return Value
The user interface layout direction (left-to-right or right-to-left).
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.