Correct me if I\'m wrong, but when I try to update my label in a while loop it won\'t update it. Is the reason that the while loop runs too quickly for the label to update w
Try Below Code, this will surely works.
while (currentSize < fileSize) {
dispatch_sync(dispatch_get_main_queue(), { () -> Void in
downloadLabel.attributedText = NSAttributedString(string: "\(currentSize) kbps", attributes: [NSFontAttributeName: UIFont(name: "Arial", size: 20)!, NSForegroundColorAttributeName: UIColor.darkTextColor()])
});
}
Just paste your UI update code to main thread as shown above. Reason : You can't update your UI from background thread.