Skip to content

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

2 participants