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

Does zipzap support progress callback? #59

Open
xmkevinchen opened this issue Apr 1, 2014 · 7 comments
Open

Does zipzap support progress callback? #59

xmkevinchen opened this issue Apr 1, 2014 · 7 comments

Comments

@xmkevinchen
Copy link

Hey guys,

Does zipzap or will support the progress callback via delegate, block or something?

It would be OK for UI

Thanks

@pixelglow
Copy link
Owner

We currently don't report progress, as zipzap is a synchronous API. It doesn't use threads or other asynchronous methods beneath the surface, and all work is done when the call returns. This generally makes it easier to reason about.

That being said, the API will work from a different, non-UI thread provided the objects are created and used in that thread. Thus it does make sense to implement a progress callback -- did you only want a callback for -[ZZMutableArchive updateEntries:error:]? Can you limit this to iOS 7 or OS X 10.9 and later, I can use NSProgress then?

@xmkevinchen
Copy link
Author

I can’t limit the usage only for iOS 7 and OS X 10.9 now,

Do you have a plan that make thing done?

Best Regards,

Kevin Chen

On Apr 4, 2014, at 1:56 PM, Glen Low [email protected] wrote:

We currently don't report progress, as zipzap is a synchronous API. It doesn't use threads or other asynchronous methods beneath the surface, and all work is done when the call returns.

That being said, the API will work from a different, non-UI thread provided the objects are created and used in that thread. Thus it does make sense to implement a progress callback -- did you only want a callback for -[ZZMutableArchive updateEntries:error:]? Can you limit this to iOS 7 or OS X 10.9 and later, I can use NSProgress then?


Reply to this email directly or view it on GitHub.

@pixelglow
Copy link
Owner

I had a good look at NSProgress and since the API is so compelling and likely to be well-supported by Apple and third parties going forward, it is likely we will use that API instead of any custom callback scheme. Thus the official client will offer progress callback via NSProgress when built for iOS 7 and OS X 10.9.

If you cannot limit usage to iOS 7 and OS X 10.9, you can write a minimal NSProgress shim to get this functionality. Let me know what you think.

@RLovelett
Copy link

@pixelglow do you have any recommendations/best practices for reading (extracting) a ZZArchive asynchronously?

Obviously I could just use GCD. Just wondering your thoughts.

@pixelglow
Copy link
Owner

@RLovelett please raise a new issue for this, thanks.

@jimwan
Copy link

jimwan commented Feb 7, 2017

@pixelglow , have you already implemented the progress callback now?
-[ZZMutableArchive updateEntries:error:] cannot be used for NSProgress

@robbiehanson
Copy link

@pixelglow Also wondering if NSProgress is implemented? I didn't see it in the API.

macguru pushed a commit to ulyssesapp/zipzap that referenced this issue Jul 18, 2020
…dents to develop

* commit '06b0cacf74aba4da571aac030fe9b554cb9d1dba':
  Fixes potential crash with empty footnotes
  Replaces anchor inset with content inset
  Changes indentation of footnotes
  Updates older test cases with new RKImageAttachment method
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

No branches or pull requests

5 participants