0

I would like to ask that is there a way to show network indicator automatically when there is network activity going on and hide the network indicator when there is no network activity

2
  • are you using NSURLConnection methods..? Feb 16, 2016 at 5:34
  • no i am using mbaas method that load stuff from the databse
    – user5892150
    Feb 16, 2016 at 5:53

1 Answer 1

0

You have to control it by using your start and completion of your network calls.

Lets say:

    - (void)viewDidAppear:(BOOL)animated{
      [super viewDidAppear:animated];
      [self showNetworkActivitySpinner];
      [self fetchDataFromServer];
    }

    - (void)fetchDataFromServer{
      [SomeApiCallClass callWebServiceWithPostData:(NSDictionary *)someDataToPost andCompletionHandler:(^void) {
        [self hideNetworkActivitySpinner];
      }];
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.