Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add right to left layout support #56

Closed
wants to merge 1 commit into from
Closed

Conversation

Moonko
Copy link
Contributor

@Moonko Moonko commented Dec 26, 2016

Respect right to left interface layout.

@mamaral
Copy link
Owner

mamaral commented Dec 27, 2016

This has been on my TODO list for a while, thanks for doing this! 👍

Taking a quick look on my phone it looks good, although I see/understand the new values but don't see where these new values are consumed. I'll try to get another look when I'm in front of a computer.

@MontakOleg
Copy link
Contributor

This is implementation of #55, great job! 👍

The only thing is different views can have different layout directions in the same app. For example playback control don't flipped on right-to-left systems. Apple uses semanticContentAttribute to specify view layout behaviour. Recommended way to get layout direction on iOS 10 is call myView.effectiveUserInterfaceLayoutDirection which internally depends on semanticContentAttribute.

Looks like we should take view in new leading an trailing factory functions to correct determine layout direction :(

On the other hand we can just ignore semanticContentAttribute . The only issue I can think is subclassing of existing UIKit views which uses non-unspecified semanticContentAttribute. In that case app code cannot use .leading() and .trailing() and must consult view of layout direction and manually use .left and .right values.

@mamaral
Copy link
Owner

mamaral commented Mar 2, 2017

Hmm I'm considering adapting this change in with a larger change in a new major version that would involve breaking changes. I'd think we want to change left and right to leading and trailing, in order to better facilitate RTL.

@mamaral
Copy link
Owner

mamaral commented Nov 6, 2017

I have my own set of changes I've been working on to support this that is a bit more extensive, that I hope to get to finishing/merging soon. Thanks for the effort nonetheless.

@mamaral mamaral closed this Nov 6, 2017
@MontakOleg MontakOleg mentioned this pull request Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants