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

Feature Request: Network Activity Indicator/Spinner #185

Closed
daylen opened this issue Oct 20, 2014 · 4 comments
Closed

Feature Request: Network Activity Indicator/Spinner #185

daylen opened this issue Oct 20, 2014 · 4 comments

Comments

@daylen
Copy link

daylen commented Oct 20, 2014

I know that AFNetworking has support for the iOS network activity indicator/spinner, but I looked everywhere and it doesn't seem like Alamofire supports this.

@mattt
Copy link
Sponsor Contributor

mattt commented Nov 29, 2014

You are correct—Alamofire does not directly implement this functionality. My current thinking is that this should be handled entirely by a separate NSURLProtocol-based mechanism, which could be shared between AFNetworking and Alamofire.

@mattt mattt closed this as completed Nov 29, 2014
@opfeffer
Copy link

@mattt I started going the NSURLProtocol route you mentioned, however got stuck pretty quickly while trying to implement my startLoading()/stopLoading() methods. From what I can tell, Alamofire currently does not expose much of its SessionDelegate class which manages the actual network callbacks for me to hook into (to hide the NetworkActivityIndicator once request completes).

Could you elaborate on your thinking a little more? Would that NSURLProtocol mechanism be able to fall back on most of the existing implementation of Alamofire or do you see the NSURLProtocol have its own NSURLSession and track its progress via its own delegate methods?

//edit: moving this to stackoverflow - http://stackoverflow.com/questions/27422675/custom-nsurlprotocol-to-show-hide-networkactivityindicator

@marcelofabri
Copy link

I just implemented this idea: https://github.com/marcelofabri/BigBrother

@tomassliz
Copy link

@marcelofabri But your implementation overrides whole Alamofire.Manager implementation. You replace NSURLSession with NSURLConnection and then methods of NSURLSessionDelegate can't be executed.

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