Type Method

userInterfaceLayoutDirection(for:relativeTo:)

Returns the layout direction implied by the specified semantic content attribute, relative to the specified layout direction.

Declaration

class func userInterfaceLayoutDirection(for semanticContentAttribute: UISemanticContentAttribute, relativeTo layoutDirection: UIUserInterfaceLayoutDirection) -> UIUserInterfaceLayoutDirection

Parameters

semanticContentAttribute

The semantic content attribute for a view.

layoutDirection

The user interface layout direction (leftToRight or rightToLeft).

Return Value

The layout direction implied by the semantic content attribute and relative to the layout direction.

Discussion

For example, when this method is passed a layout direction of rightToLeft and a semantic content attribute of playback, it returns leftToRight. Although layout and drawing code can use this method to determine how to arrange elements, it might be easier to query the container view’s effectiveUserInterfaceLayoutDirection property instead.