Returns the user interface direction for the given semantic content attribute.
SDKs
- iOS 9.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- UIKit
Declaration
+ (UIUser Interface Layout Direction)userInterfaceLayoutDirectionForSemanticContentAttribute:(UISemantic Content Attribute)attribute;
Parameters
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.