-
Notifications
You must be signed in to change notification settings - Fork 526
Description
hi i am using M13ProgressSuite. it is very good.
but i found a problem and want to look for help.
a function called "setProgress(_ progress: CGFloat, animated: Bool)" in M13ProgressView class
will crash if call it quickly.
this is my code i update the progress with M13ProgressViewImage class instance.
the callback function is very fast.so it will call "setProgress" very quickly.
Each time crash in M13ProgressViewImage class line 244 (rgbaPixel[RED] = 0;)
func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) {
let percentage = CGFloat(CGFloat(totalBytesWritten)/CGFloat(totalBytesExpectedToWrite))
DispatchQueue.main.async {
self.progressView.setProgress(percentage, animated: true)
}
}