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

make reverseContentLayout externally modifiable #568

Conversation

toya108
Copy link
Contributor

@toya108 toya108 commented Apr 1, 2024

Why

The reverseContentLayout is currently determined by the TOCropToolBar's semanticContentAttributes and is used when determining whether the view should be reversed left or right.

self.reverseContentLayout = ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft);

However, this is determined at setup time and cannot be changed later.
This makes it difficult to determine the layout direction externally.

How

Expose reverseContentLayout and allow it to be changed externally.
In addition, call setNeedsLayout in the setter to change the layout according to the changed value.

ScreenShot

CropViewControllerExample

reverseContentLayout is false reverseContentLayout is true

TOCropViewControllerExample

reverseContentLayout is false reverseContentLayout is true

@TimOliver TimOliver merged commit 63c8f6c into TimOliver:main Apr 6, 2024
@TimOliver
Copy link
Owner

This PR is fantastic! Thanks so much @toya108!

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.

None yet

2 participants