Skip to content

Crash problem #125

Open
Open

Description

@ericji-o

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions