You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think a little bit about that.
As a basis idea we can take AutoLayout approach: .leading means .left on left-to-right languages and means .right on right-to-left languages; .trailing means .right on left-to-right languages and means .left on right-to-left languages.
We can implement this by simple adding factory functions to our enums(Edge, Corner, Align), for example for Edge:
publicenumEdge{case top
case left
case bottom
case right
staticfunc leading()->Edge{returnisRightToLeft() ? .right :.left
}staticfunc trailing()->Edge{returnisRightToLeft() ? .left :.right
}}
Then if client code wants to respect language direction, it should use .leading() and .trailing() functions instead .left and .right:
I think a little bit about that.
As a basis idea we can take AutoLayout approach:
.leading
means.left
on left-to-right languages and means.right
on right-to-left languages;.trailing
means.right
on left-to-right languages and means.left
on right-to-left languages.We can implement this by simple adding factory functions to our enums(Edge, Corner, Align), for example for
Edge
:Then if client code wants to respect language direction, it should use .leading() and .trailing() functions instead .left and .right:
@mamaral what you think about this approach? Any suggestions?
The text was updated successfully, but these errors were encountered: