I want to show progress bar when press a button to move another ViewController
(This ViewController
is load with huge amount of data from the WebService) and after load all data progress bar will be dismiss.
I mean first press a button then immediately move to another ViewController
with progress bar and progress bar dismiss after load all data.
here I add the code for move to another ViewController
:
UIStoryboard *sb=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
Guide *guideVC = [sb instantiateViewControllerWithIdentifier:@"Guide"];
[self.navigationController pushViewController:guideVC animated:YES];
And WebService simply fetch in viewDidLoad
method on new ViewController
.
How can I do this. Any one give the solution.
Here i have just show you how to dissmiss SVProgress Here i have used my own APIManager(Using Alamofire) Custom class for Api calling
override func viewDidLoad() {
super.viewDidLoad()
self.fetchList()
}
func fetchList() {
SVProgressHUD.show()
APIManager.callAPIRequest(Method: .post, url: urlStr, parameters: parameters, headers: headers, completion:
{ (result, headerMessage) in
let dicJSONResponse = result.dictionaryValue
//SuccessBlock
SVProgressHUD.dismiss()
}) { (httpresponse, errorMessage) in
//Failure blog
SVProgressHUD.dismiss()
}
}
Please do the following:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.