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

feat: support async crop #232

Merged
merged 3 commits into from
Nov 14, 2022
Merged

feat: support async crop #232

merged 3 commits into from
Nov 14, 2022

Conversation

guoyingtao
Copy link
Owner

fix #161

@guoyingtao guoyingtao mentioned this pull request Nov 13, 2022
Copy link
Collaborator

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

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

Would be nice to also have an API where activityIndicator isn't used at all. I'd want to have my own loading view shown instead of the one from the library

Sources/Mantis/CropView/CropView.swift Outdated Show resolved Hide resolved
@guoyingtao
Copy link
Owner Author

Would be nice to also have an API where activityIndicator isn't used at all. I'd want to have my own loading view shown instead of the one from the library

Thanks for the suggestion! I will think about it.

activityIndicator.isHidden = false
activityIndicator.startAnimating()

DispatchQueue.global(qos: .userInteractive).async {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we also need?

Suggested change
DispatchQueue.global(qos: .userInteractive).async {
DispatchQueue.global(qos: .userInteractive).async { [weak self] in

Copy link
Owner Author

Choose a reason for hiding this comment

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

No it is not needed. DispatchQueue does not hold strong self to it won't cause retain cycle.
You can test it by putting a breakpoint in deinit

@guoyingtao
Copy link
Owner Author

I found some code in crop() which should only be called in the main thread. I need to fix them.

@guoyingtao
Copy link
Owner Author

I found some code in crop() which should only be called in the main thread. I need to fix them.

Fixed

@guoyingtao
Copy link
Owner Author

Would be nice to also have an API where activityIndicator isn't used at all. I'd want to have my own loading view shown instead of the one from the library

I created a new issue #233 and plan to do it in a separate PR.

@guoyingtao guoyingtao merged commit 69e5640 into master Nov 14, 2022
@guoyingtao guoyingtao deleted the add-async-crop branch January 28, 2023 09:00
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.

Add asynchronous crop support
2 participants