I'm Ruslan - iOS and Blockchain enthuziast, currently working on Trust Wallet.
rsrbk / srcountdowntimer Goto Github PK
View Code? Open in Web Editor NEWThis is the simple circle countdown with a configurable timer for iOS.
License: MIT License
This is the simple circle countdown with a configurable timer for iOS.
License: MIT License
Do you have a used code sample?
Want to check current text of SRCountdownTimer and perform action accordingly please help.
i am trying to change the look of the trailing line from solid to gradient. (basically, it should start with green and end with red color in a 'gradient-ish' way when the timer is completed. any idea how i might accomplish that?
Hi! First of all thanks sharing your pod to the open source community.
I was playing around with some Countdown Pods to integrate one into my app which Is already live in the stores.
Unfortunately im not able to see the timer label in the circle. Any help would be appreciated.
I can see the Label in the view hierarchy but it has no frame and so its not visible ..
Cheers.
`class CountdownViewController: UIViewController, SRCountdownTimerDelegate {
private var countdownView: CountdownView {
return view as! CountdownView
}
// MARK: - View Lifecycle
override func loadView() {
view = CountdownView()
}
override func viewDidLoad() {
super.viewDidLoad()
countdownView.countdownTimer.delegate = self
countdownView.countdownTimer.start(beginingValue: 5, interval: 1)
}
// MARK: - SRCountdowntimer Delegate
func timerDidUpdateCounterValue(sender: SRCountdownTimer, newValue: Int) {
print(newValue)
}
func timerDidStart(sender: SRCountdownTimer) {
print("Start")
}
func timerDidEnd(sender: SRCountdownTimer, elapsedTime: TimeInterval) {
print("End")
}
}`
`class CountdownView: UIView {
public let countdownTimer: SRCountdownTimer = {
let timer = SRCountdownTimer()
timer.translatesAutoresizingMaskIntoConstraints = false
timer.backgroundColor = .white
timer.lineColor = .systemGreen
timer.labelTextColor = .black
timer.isLabelHidden = false
timer.labelFont = .systemFont(ofSize: 30)
timer.timerFinishingText = "Finish"
return timer
}()
// MARK: - Object Lifecycle
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
addSubview(countdownTimer)
setupConstraints()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) not supported!")
}
// MARK: - Layout
private func setupConstraints() {
// Timer
NSLayoutConstraint.activate([countdownTimer.centerYAnchor.constraint(equalTo: centerYAnchor),
countdownTimer.centerXAnchor.constraint(equalTo: centerXAnchor),
countdownTimer.heightAnchor.constraint(equalToConstant: 300),
countdownTimer.widthAnchor.constraint(equalToConstant: 300)])
}
}`
Hi team,
I need to show an rectangular timer with loading progress bar.
Where can I changed the code please help me, I have an requirement ASAP.
It's posible to have the label in minutes?
Continue countdown timer when app is running in background
I added the timerDidEnd function to my Viewcontroller but it doesn't seem run.
func timerDidEnd(sender: SRCountdownTimer, elapsedTime: TimeInterval) {
print("ended")
}
Circle does not fill the ring in these scenarios
countdownTimer.start(beginingValue: 2, interval: 1)
or
countdownTimer.start(beginingValue: 2, interval: 0.2)
Feature request
Fractions of a second displayed instead of just int
For example, 1.2, 1.3, etc
I may try and work on this if I have time but not sure if author better understood it
Hi,
I hope you are doing well in pandemic. I am using your SRCountdownTimer in my fitness app.
I am stating countdownTimer in the viewdidLoad. countdownTimer.start(beginingValue: 10, interval: 1) First time it's working perfectly. When timer reach to 0 then after I reset timer using your method. I implemented in the SRCountdownTimer.swift file as per your instruction (pull request). Now I am calling countdownTimer.start(beginingValue: 60, interval: 1) after reset then animation is not starting.
What is the problem ? Countdown is not again stating in your code. Please provide me solution as soon as possible.
Getting How much Time is elapsed?, when i stop the quiz,want to take note of that as well
fixed
There is no reset property for circular progressView. How to achieve to reset trail line ?
Will there be any Apple Watch support for this?
Currently, the direction is clockwise. Add enhancement to move the direction anticlockwise also.
I have migrated my project to Swift 4.2. Now your pod is not working.. seriously man you did not upgrade to Swift 4.2?
I have setup SRCountdownTimer for 10 secs, and it takes about 17 secs to the full count down.
Where could be the issue ?
Feature request, fill middle of circle with color
It will be useful have to have the possibility to display the inner label when initializing the Countdown timer without starting it. Something like this:
public func initialize(beginingValue: Int, interval: TimeInterval = 1) {
self.beginingValue = beginingValue
self.interval = interval
totalTime = TimeInterval(beginingValue) * interval
elapsedTime = 0
timer?.invalidate()
currentCounterValue = beginingValue
setNeedsDisplay()
}
Hi.
I'm getting the following error:
Invalid
Podfile file: No such file or directory - SRCountdownTimer.
I tried with pod
SRCountdownTimer`` and pod 'SRCountdownTimer'
What is minimum deployment target?
Hey
Can you help me figure out when the timer is finished ?
I see that there is a delegate for that, but I have no idea how to implement that ...
Thanks
My UI has a WKWebView and whenever the user touches the WKWebView and scrolls the timer stops.
Any idea?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.