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 want my signupButton to have it's trailing edge 20 points before safeAreaLayoutGuide.centerXAnchor. Similarly, I want my loginButton to have its leading edge 20 points after safeAreaLayoutGuide.centerXAnchor. Below image displays the layout in desired state:
Left-to-Right Layout 👆🏾
Right-to-Left Layout 👆🏾
Well, I have been using ternary operator in order to pass proper values for RTL (myRandomImageView.leadingToSuperview(offset: isRTL ? -11 : 11)). But now I realized it's not the best approach as it can be fixed in the future. So the layout would get "broken" for RTL languages again. So better is to go with leading(to:) / trailing(to:) methods.
What layout do I expect?
I want my
signupButton
to have it's trailing edge 20 points beforesafeAreaLayoutGuide.centerXAnchor
. Similarly, I want myloginButton
to have its leading edge 20 points aftersafeAreaLayoutGuide.centerXAnchor
. Below image displays the layout in desired state:Left-to-Right Layout 👆🏾
Right-to-Left Layout 👆🏾
What does my code looks like?
What output do I get with above code?
Below are the screenshots of my output:
Left-to-Right Layout 👆🏾
Right-to-Left Layout 👆🏾
The problem
It looks like the way
superview
methods are implemented, they work correct only for Left-to-Right language / layout direction.The text was updated successfully, but these errors were encountered: