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

Breaking Out of Progress Bar Thread #6

Open
ttseng opened this issue Oct 20, 2015 · 0 comments
Open

Breaking Out of Progress Bar Thread #6

ttseng opened this issue Oct 20, 2015 · 0 comments

Comments

@ttseng
Copy link

ttseng commented Oct 20, 2015

I'm using the progress bar to count down to 0 – once the timer is finished, I want to trigger a method in my View Controller.

Do you have any sample code that will break out of your thread to call a function on the main queue?

Here is my current code:

    [MCUtil runOnAuxiliaryQueue:^{
        while(currentTime < timeLimit && self.isRecording){
            [MCUtil runOnMainQueue:^{
                currentTime += 0.01;
                self.audioProgress.percentage = (float)currentTime/timeLimit;
            }];
            [NSThread sleepForTimeInterval:0.01];
        }
        NSLog(@"reached end of time limit");
        // calling method here has delay?
    }];
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