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

Is it possible to count up instead of down? #42

Open
roundfly opened this issue Nov 28, 2018 · 1 comment
Open

Is it possible to count up instead of down? #42

roundfly opened this issue Nov 28, 2018 · 1 comment

Comments

@roundfly
Copy link

Not really an issue so close this but was just wondering wether it's possible to count upwards instead of down, given a value of say 30 minutes but starting from 0 then going to 30? None of the public API method's seem to be able to point me in the right direction regarding this.
Also props on this framework, +star from me.

@AmirMehr
Copy link

AmirMehr commented Jan 14, 2019

I handle it as follow:
I set a time interval that call add function every 1 second, it will automatically animate

`

			// 0 is the start time to increase
			let time: TimeInterval = TimeInterval(0)

			orderCountDown.setCountDownTime(minutes: time)

			orderCountDown.timeFormat = "mm:ss"

			orderCountDown.animationType = .Evaporate

			// set a time interval to repeat every second and add time to it
			// it will automatically animate
				Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(CurrentOrderCell.addTime), userInfo: nil, repeats: true)
			

			@objc func addTime(){

					order.remainSeconds += 1

					let time: TimeInterval = TimeInterval(order.remainSeconds)

					orderCountDown.setCountDownTime(minutes: time)

				}

			`

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

2 participants