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

Undo/Redo Feature for Mantis #379

Merged
merged 42 commits into from
Mar 24, 2024
Merged

Undo/Redo Feature for Mantis #379

merged 42 commits into from
Mar 24, 2024

Conversation

rickshane
Copy link
Contributor

This is the Undo/Redo feature for Mantis.

@guoyingtao
Copy link
Owner

This feature is for Mantis, I think we need to move more code related to undo/redo from Example project into Mantis to make undo/redo easier to use.

@guoyingtao
Copy link
Owner

We may need to add some properties in Config enable/disable undo/redo
Mantis only provides basic features by default but provide more features by turning on switches in Config.

Copy link
Owner

@guoyingtao guoyingtao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
I added some comments. Please take a look.

- added "enableUndo" flag in Config
- undo/redo/reset logic checks the "enableUndo" flag in cropViewController to enable functionality
- abstracted the TransformRecord logic into the CropViewController class
- removed UIButtons from TransformDelegate
- moved TransformDelegate in to new file in the Protocols folder
@rickshane
Copy link
Contributor Author

All comments/issues have been addressed.

Copy link
Owner

@guoyingtao guoyingtao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick update.
I added more comments. Please take a look.

- More private variables.
- Embedded controller uses proxy functions to communicate with CropViewController state.
- Defaults function implementations in delegate methods.
@rickshane
Copy link
Contributor Author

latest comments addressed

@guoyingtao
Copy link
Owner

Thanks for the quick fixes!
I will go back to continue the reviews when I get more time.

- TransformStack.swift
- TransformRecord.swift
- TransformDelegate.swift
@rickshane
Copy link
Contributor Author

Added new files to Mantis.xcodeproj

@guoyingtao
Copy link
Owner

Added new files to Mantis.xcodeproj

Thanks for doing that!
Can you also fix the building errors for Unit Tests? Some test codes are failed to build due to the recent code changes.

image

- cropViewControllerDidUpdateEnableStateForUndo(_ enable: Bool) -> cropViewController(_ cropViewController: CropViewController, didUpdateEnableStateForUndo enable: Bool)

- cropViewControllerDidUpdateEnableStateForRedo(_ enable: Bool) -> cropViewController(_ cropViewController: CropViewController, didUpdateEnableStateForRedo enable: Bool)

- cropViewControllerDidUpdateEnableStateForReset(_ enable: Bool) -> cropViewController(_ cropViewController: CropViewController, didUpdateEnableStateForReset enable: Bool)
@rickshane
Copy link
Contributor Author

Fixed unit test in Mantis.xcodeproj related to new API for undo/redo feature.

Copy link
Owner

@guoyingtao guoyingtao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
Thanks for your work!

@guoyingtao guoyingtao merged commit 9a1e67a into guoyingtao:master Mar 24, 2024
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