Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash problem #125

Open
ericji-o opened this issue Jul 12, 2017 · 0 comments
Open

Crash problem #125

ericji-o opened this issue Jul 12, 2017 · 0 comments

Comments

@ericji-o
Copy link

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)
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant