I am showing an alertController and if the user clicks Yes an ProgressView should be shown, but unfortunately the Progressview and the label does not appear. How can I refresh my ViewController. Here the cod that is executed for the yes-handler of the alertController. The code will be executed without problem, but the progressview is not appearing:
func initProgressView(){
turn = 0
let xCoord = self.view.center.x
let yCoord = self.view.center.y + 10
progressLabel = UILabel(frame: CGRect(x: xCoord, y: yCoord, width: 100, height: 23))
progressLabel.text = "0 %"
progressLabel.font = UIFont.boldSystemFontOfSize(14)
progressView.center = self.view.center
progressView.trackTintColor = UIColor.lightGrayColor()
progressView.tintColor = UIColor.blueColor()
// self.view.backgroundColor = UIColor.yellowColor()
self.view.addSubview(progressLabel)
self.view.addSubview(progressView)
}
here the complete sequence of call: initProgressView() //see previous post
then call of importData:
func importData (source : ImportDataInterface, data : NSData, progressStep : Int) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), {
source.importData(data)
dispatch_async(dispatch_get_main_queue(), {
self.counter += progressStep
return
})
})
}
and finally in the calling function: progressView.removeFromSuperview() progressLabel.removeFromSuperview()
How can I refresh the ViewController or what else could be the reason why the progressView does not appear. Can it be, that constraints or autolayout issues are the problem.
thanks Arnold