Closed xinatanil closed 1 year ago
@xinatanil
Do you mean you want to provide two status active/deactivate
for reset
button?
The current logic is to hide/show
reset
button when checking if it is resettable.
Yes, something like that via KVO or delegate method. For my custom UI I'd like to hide the reset button when it's not needed.
@xinatanil
So do you mean you want to set your own icon for reset
button?
No, I want a way for me to know that reset button has been activated/deactivated, so that I could disable my own custom UI elements. Currently, I see no easy way for that.
@xinatanil
For activated
status, you can use delegate function cropViewControllerDidImageTransformed
. For deactivated
status, I can add a new delegate function for it.
That'd be great!
Something like func cropViewController(_ cropViewController: CropViewController, didBecomeResettable resettable: Bool)
would be amazing
@xinatanil Please check #317 to see if it works for you, then I can make a new release later.
Looks fantastic! Thank you for a quick response!
@xinatanil Just released Mantis 2.12.0 for this feature. Please have a try.
I'm building an embedded version of the CropViewController with my own overlay UI. To my surprise, there was no easy way for me to activate/deactivate "reset" button. While CropViewDelegate provides the necessary methods, accessing it is impossible (or I didn't figure it out). The most simple solution, like subclassing CropViewController and overriding "didBecomeResettable" is impossible because "extension CropViewController: CropViewDelegate" is not public.
The only solution I see right now is to fork the repo and manually add necessary methods to CropViewControllerDelegate. Is there a simpler and more elegant way?