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

Adding a countdown to a default button #113

Closed
kalsky opened this issue May 18, 2015 · 4 comments
Closed

Adding a countdown to a default button #113

kalsky opened this issue May 18, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@kalsky
Copy link

kalsky commented May 18, 2015

When you set the duration of the alert, it would be nice if we can show a timer on the default button (either the done button or any other button that the developer thinks should be the default).
It can work the same as implemented in Waze for most of their popups.
Similar question was asked here, and a sample code is also attached:
http://stackoverflow.com/questions/11783439/uibutton-with-timer

I'll try to integrate it on my own and share it if i'll have time - but if not, it would be nice having this feature built in with this great project.

Yaniv

@dogo dogo added the feature label May 21, 2015
@dogo
Copy link
Owner

dogo commented May 21, 2015

Ohhhh I really liked this! @kalsky
Added to my TODO 🎯

A PR to add this feature would be much appreciated.

@dogo dogo self-assigned this May 21, 2015
@dogo dogo added this to the 0.8.x milestone May 21, 2015
@dogo
Copy link
Owner

dogo commented Aug 18, 2015

@kalsky Feature provided by @yatryan

@dogo dogo closed this as completed Aug 18, 2015
@kalsky
Copy link
Author

kalsky commented Sep 17, 2015

Thanks for adding this!
But your countdown counts forward.. it's actually a timer..
I changed the code in the SCLTimerDisplay to:

  • (void)updateTimerButton:(NSTimer *)timer{
    currentTime -= TIMER_STEP;
    currentAngle = (currentTime/timerLimit) * 360 + START_DEGREE_OFFSET;

    if(currentTime<=0) {
    [self stopTimer];
    }
    }

and in the startTimerWithTimeLimit, I set the currentTime to tl as well.

@dogo
Copy link
Owner

dogo commented Sep 17, 2015

ahhahaha thats true! Fixed now, supports countdown and timer :D

Commit 9478ccc

Please update to 0.7.7

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

No branches or pull requests

2 participants