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

Download tracking implemented to TTURLRequest #288

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
1 participant
@cemaleker
Copy link
Contributor

cemaleker commented Oct 5, 2010

With this small change you can track download status from TTURLRequest of you model. It's good with big files. Easy to implement with TTActivityLabel. I have also implemented a category for TTURLRequestModel, but its not included in this commit. I'm adding it to comment.

//=====================

@implementation TTURLRequestModel (CBGNPAdditions)

  • (CGFloat)loadedRatio {
    if (!!_loadingRequest) {
    if (_loadingRequest.totalBytesDownloaded > 0) {
    return ((float)_loadingRequest.totalBytesDownloaded / (float)_loadingRequest.totalContentLength);
    }
    return 0;
    }
    else if (!!_loadedTime) {
    return 1;
    }
    else {
    return 0;
    }

}

@EnD

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment