well, I am just about to turn crazy. I am a swift beginner with quite a big programming action going on and it is getting a bit overwhelming. Maybe you can assist.
func getDataFromDatamanager() {
DataManager.getGoldPriceFromQuandlWithSuccess { (QuandlGoldPrice) -> Void in
let json = JSON(data: QuandlGoldPrice)
if let datasetMineral = json["dataset"]["dataset_code"].string {
print("NSURLSession: \(datasetMineral)")
}
DataManager.getSilverPriceFromQuandlWithSuccess { (QuandlSilverPrice) -> Void in
let json = JSON(data: QuandlSilverPrice)
if let datasetMineral = json["dataset"]["dataset_code"].string {
print("NSURLSession: \(datasetMineral)")
}
}
There are about 15 other calls in this function and they all need a different time to download. I am calling the function to operate on the main thread and to start an activity Indicator:
dispatch_async(dispatch_get_main_queue(), {
self.activityIndicator.startAnimating()
self.getDataFromDatamanager()
})
My question: How can I stop the activity Indicator only once all functions are downloaded?